From b9bde15c1fadd88ed35b915481d90ea2c799b8bb Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 18 Apr 2024 18:22:15 +0800 Subject: feat: add config `buffer_editor` (#417) --- src/repl/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/repl') 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"###, ); } -- cgit v1.2.3