summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-04 09:22:55 +0800
committerGitHub <noreply@github.com>2023-03-04 09:22:55 +0800
commitdbdb2ed125214d7dab9dd2ef6ed03e1062b7cc27 (patch)
tree678fe6be7439c31e5cc804cf20d9cf30ccbff3d1 /src/config.rs
parent0fa1ae215ac1434591968818f8f75ad5b35d52ec (diff)
downloadaichat-dbdb2ed125214d7dab9dd2ef6ed03e1062b7cc27.tar.gz
refactor: replace config.highlight with config.no_highlight (#4)
* refactor: replace config.highlight with config.no_highlight * update readme
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/config.rs b/src/config.rs
index cce6b6a..1c6abc5 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -24,9 +24,9 @@ pub struct Config {
/// Whether to persistently save chat messages
#[serde(default)]
pub save: bool,
- /// Whether to highlight reply message
+ /// Whether to disable highlight
#[serde(default)]
- pub highlight: bool,
+ pub no_highlight: bool,
/// Set proxy
pub proxy: Option<String>,
/// Used only for debugging
@@ -175,14 +175,6 @@ fn create_config_file(config_path: &Path) -> Result<()> {
raw_config.push_str("save: true\n");
}
- let ans = Confirm::new("Whether to highlight reply message?")
- .with_default(true)
- .prompt()
- .map_err(confirm_map_err)?;
- if ans {
- raw_config.push_str("highlight: true\n");
- }
-
std::fs::write(config_path, raw_config)
.map_err(|err| anyhow!("Failed to write to config file, {err}"))?;
Ok(())