summaryrefslogtreecommitdiffstats
path: root/src/repl.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-05 19:48:22 +0800
committerGitHub <noreply@github.com>2023-03-05 19:48:22 +0800
commit957ea431c23dd6cbaa512e6a67b4a25e2adf08e4 (patch)
tree334182bf2e730f8d422e855e120df9de94bed534 /src/repl.rs
parentaadffb17a3cbbfc5e3c0dad4c8587eff79aaae9b (diff)
downloadaichat-957ea431c23dd6cbaa512e6a67b4a25e2adf08e4.tar.gz
refactor: rename config.no_highlight to highlight (#19)
Diffstat (limited to 'src/repl.rs')
-rw-r--r--src/repl.rs8
1 files changed, 4 insertions, 4 deletions
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<Config>, role: Option<Role>) -> Result<Self> {
- 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 {