From eff69a482d55d182448ff191203f05efc2878d4c Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 2 Nov 2023 16:08:11 +0800 Subject: feat: add `.set auto_copy` (#200) --- README.md | 9 +++++---- src/config/mod.rs | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 38db895..00afeb0 100644 --- a/README.md +++ b/README.md @@ -149,10 +149,6 @@ Press Ctrl+C to abort readline, Ctrl+D to exit the REPL ``` 〉.info -config_file /home/alice/.config/aichat/config.yaml -roles_file /home/alice/.config/aichat/roles.yaml -messages_file /home/alice/.config/aichat/messages.md -sessions_dir /home/alice/.config/aichat/sessions model openai:gpt-3.5-turbo temperature - save true @@ -162,6 +158,10 @@ wrap no wrap_code false dry_run false keybindings emacs +config_file /home/alice/.config/aichat/config.yaml +roles_file /home/alice/.config/aichat/roles.yaml +messages_file /home/alice/.config/aichat/messages.md +sessions_dir /home/alice/.config/aichat/sessions ``` ### `.edit` - multiline editing @@ -258,6 +258,7 @@ compared to the maximum number of tokens allowed by the model. 〉.set dry_run true 〉.set highlight false 〉.set save false +〉.set auto_copy true ``` ## Command Line diff --git a/src/config/mod.rs b/src/config/mod.rs index da197b9..1b00832 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -404,6 +404,7 @@ impl Config { format!("save {}", !self.save), format!("highlight {}", !self.highlight), format!("dry_run {}", !self.dry_run), + format!("auto_copy {}", !self.auto_copy), ] } _ => vec![], @@ -446,6 +447,10 @@ 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(()) -- cgit v1.2.3