From 957ea431c23dd6cbaa512e6a67b4a25e2adf08e4 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sun, 5 Mar 2023 19:48:22 +0800 Subject: refactor: rename config.no_highlight to highlight (#19) --- src/repl.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/repl.rs') diff --git a/src/repl.rs b/src/repl.rs index b507d89..98f43f1 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -257,10 +257,10 @@ struct ReplCmdHandlerState { impl ReplCmdHandler { pub fn init(client: ChatGptClient, config: Arc, role: Option) -> Result { - let render = if config.no_highlight { - None - } else { + let render = if config.highlight { Some(Arc::new(MarkdownRender::init()?)) + } else { + None }; let save_file = config.open_message_file()?; let ctrlc = Arc::new(AtomicBool::new(false)); @@ -367,7 +367,7 @@ impl ReplCmdHandler { .unwrap_or_default(), ), ("save messages", self.config.save.to_string()), - ("highlight", (!self.config.no_highlight).to_string()), + ("highlight", (self.config.highlight).to_string()), ]; let mut info = String::new(); for (name, value) in items { -- cgit v1.2.3