diff --git a/src/main.rs b/src/main.rs index 0cfe93c6b7..9bda4f8b75 100644 --- a/src/main.rs +++ b/src/main.rs @@ -230,6 +230,18 @@ fn main() -> Result<()> { //Reset the ctrl-c handler ctrlc.store(false, Ordering::SeqCst); + // Get animation milliseconds every loop, if not set, the animation + // is defaulted to 1 second. If set to some non-number value, + // like "OFF", then the animation is disabled. If set to some number + // like "5000" then the animation will run at 5 seconds. + let animate_ms = match std::env::var("EQ_PROMPT_ANIMATE_MS") { + Ok(ms_str) => match ms_str.parse::() { + Ok(ms_int) => Some(ms_int), + _ => None, + }, + _ => Some(1000), + }; + let line_editor = Reedline::create() .into_diagnostic()? .with_completion_action_handler(Box::new(FuzzyCompletion { @@ -238,6 +250,7 @@ fn main() -> Result<()> { .with_highlighter(Box::new(NuHighlighter { engine_state: engine_state.clone(), })) + .with_repaint(animate_ms) // .with_completion_action_handler(Box::new( // ListCompletionHandler::default().with_completer(Box::new(completer)), // ))