summaryrefslogtreecommitdiffstats
path: root/src/repl
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-18 18:22:15 +0800
committerGitHub <noreply@github.com>2024-04-18 18:22:15 +0800
commitb9bde15c1fadd88ed35b915481d90ea2c799b8bb (patch)
tree7ae94414af60dfca71197a8f3c9f620f2a2666df /src/repl
parent9149954c7bbc5cce541793e2e7cdcd50b6af2a3c (diff)
downloadaichat-b9bde15c1fadd88ed35b915481d90ea2c799b8bb.tar.gz
feat: add config `buffer_editor` (#417)
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/repl/mod.rs b/src/repl/mod.rs
index 30be73b..4de4251 100644
--- a/src/repl/mod.rs
+++ b/src/repl/mod.rs
@@ -316,7 +316,7 @@ Type ".help" for more information.
.with_validator(Box::new(ReplValidator))
.with_ansi_colors(true);
- if let Ok(cmd) = env::var("VISUAL").or_else(|_| env::var("EDITOR")) {
+ if let Some(cmd) = config.read().buffer_editor() {
let temp_file =
env::temp_dir().join(format!("aichat-{}.txt", chrono::Utc::now().timestamp()));
let command = process::Command::new(cmd);
@@ -425,7 +425,7 @@ fn dump_repl_help() {
r###"{head}
Type ::: to begin multi-line editing, type ::: to end it.
-Press Ctrl+O to open an editor to modify the current prompt.
+Press Ctrl+O to open an buffer editor to modify the current prompt.
Press Ctrl+C to abort aichat, Ctrl+D to exit the REPL"###,
);
}