From dbdb2ed125214d7dab9dd2ef6ed03e1062b7cc27 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 4 Mar 2023 09:22:55 +0800 Subject: refactor: replace config.highlight with config.no_highlight (#4) * refactor: replace config.highlight with config.no_highlight * update readme --- src/repl.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/repl.rs') diff --git a/src/repl.rs b/src/repl.rs index f8a10a3..bb33bc1 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -196,10 +196,10 @@ struct ReplCmdHandlerState { impl ReplCmdHandler { pub fn init(client: ChatGptClient, config: Arc, role: Option) -> Result { - let render = if config.highlight { - Some(Arc::new(MarkdownRender::init()?)) - } else { + let render = if config.no_highlight { None + } else { + Some(Arc::new(MarkdownRender::init()?)) }; let prompt = role.map(|v| v.prompt).unwrap_or_default(); let save_file = config.open_message_file()?; -- cgit v1.2.3