summaryrefslogtreecommitdiffstats
path: root/src/config
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-06-17 11:40:12 +0800
committerGitHub <noreply@github.com>2024-06-17 11:40:12 +0800
commitbbdd866eb325fde60241f33eeb8770b1180abd96 (patch)
tree5ae91d10dd481f744c905cb08e93307b01232692 /src/config
parent189f2271bcc6f841264cb960e35e78c870663645 (diff)
downloadaichat-bbdd866eb325fde60241f33eeb8770b1180abd96.tar.gz
feat: abandon `auto_copy` (#607)
Diffstat (limited to 'src/config')
-rw-r--r--src/config/mod.rs19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 6cbbc05..23ee153 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -93,7 +93,6 @@ pub struct Config {
pub light_theme: bool,
pub wrap: Option<String>,
pub wrap_code: bool,
- pub auto_copy: bool,
pub keybindings: Keybindings,
pub prelude: Option<String>,
pub repl_prelude: Option<String>,
@@ -146,7 +145,6 @@ impl Default for Config {
light_theme: false,
wrap: None,
wrap_code: false,
- auto_copy: false,
keybindings: Default::default(),
prelude: None,
repl_prelude: None,
@@ -450,7 +448,6 @@ impl Config {
("light_theme", self.light_theme.to_string()),
("wrap", wrap),
("wrap_code", self.wrap_code.to_string()),
- ("auto_copy", self.auto_copy.to_string()),
("keybindings", self.keybindings.stringify().into()),
("prelude", format_option_value(&self.prelude)),
("config_file", display_path(&Self::config_file()?)),
@@ -518,10 +515,6 @@ impl Config {
let value = value.parse().with_context(|| "Invalid value")?;
self.dry_run = value;
}
- "auto_copy" => {
- let value = value.parse().with_context(|| "Invalid value")?;
- self.auto_copy = value;
- }
_ => bail!("Unknown key `{key}`"),
}
Ok(())
@@ -1048,7 +1041,6 @@ impl Config {
"save_session",
"highlight",
"dry_run",
- "auto_copy",
]
.into_iter()
.map(|v| (format!("{v} "), None))
@@ -1074,7 +1066,6 @@ impl Config {
}
"highlight" => complete_bool(self.highlight),
"dry_run" => complete_bool(self.dry_run),
- "auto_copy" => complete_bool(self.auto_copy),
_ => vec![],
};
(values.into_iter().map(|v| (v, None)).collect(), args[1])
@@ -1172,9 +1163,6 @@ impl Config {
output.insert("wrap", wrap.clone());
}
}
- if self.auto_copy {
- output.insert("auto_copy", "true".to_string());
- }
if !role.is_derived() {
output.insert("role", role.name().to_string());
}
@@ -1232,7 +1220,6 @@ impl Config {
input.clear_patch_text();
self.last_message = Some((input.clone(), output.to_string(), self.bot.is_some()));
self.save_message(input, output, tool_results)?;
- self.maybe_copy(output);
Ok(())
}
@@ -1281,12 +1268,6 @@ impl Config {
.with_context(|| "Failed to save message")
}
- fn maybe_copy(&self, text: &str) {
- if self.auto_copy {
- let _ = set_text(text);
- }
- }
-
fn open_message_file(&self) -> Result<File> {
let path = self.messages_file()?;
ensure_parent_exists(&path)?;