diff --git a/lumni/src/apps/builtin/llm/prompt/src/tui/events/handle_prompt_window.rs b/lumni/src/apps/builtin/llm/prompt/src/tui/events/handle_prompt_window.rs index 59c6ba8e..19420dc7 100644 --- a/lumni/src/apps/builtin/llm/prompt/src/tui/events/handle_prompt_window.rs +++ b/lumni/src/apps/builtin/llm/prompt/src/tui/events/handle_prompt_window.rs @@ -97,6 +97,14 @@ pub fn handle_prompt_window_event( '-' => { app_ui.set_primary_window(WindowKind::ResponseWindow); } + ' ' => { + if let Some(prev) = key_track.previous_key_str() { + if prev == " " { + // change to insert mode if double space + return Ok(Some(app_ui.set_prompt_window(true))); + } + } + } _ => {} } } diff --git a/lumni/src/apps/builtin/llm/prompt/src/tui/events/key_event.rs b/lumni/src/apps/builtin/llm/prompt/src/tui/events/key_event.rs index d574758e..719b7b62 100644 --- a/lumni/src/apps/builtin/llm/prompt/src/tui/events/key_event.rs +++ b/lumni/src/apps/builtin/llm/prompt/src/tui/events/key_event.rs @@ -68,7 +68,8 @@ impl KeyTrack { } match new_c { ' ' => { - self.previous_key_str = Some(String::new()); + // double space + self.set_leader_key(false); } 'i' => { // currently insert always disables leader key