From 27fcd8d180cb8a1cdb45314229cae3d78318a75c Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Sat, 9 Mar 2024 09:02:43 +0100 Subject: [PATCH] helix-term: allow to backspace out-of the command prompt (#9828) --- helix-term/src/ui/prompt.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index a6ee7f05dde6..d46c13138194 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -544,6 +544,10 @@ impl Component for Prompt { (self.callback_fn)(cx, &self.line, PromptEvent::Update); } ctrl!('h') | key!(Backspace) | shift!(Backspace) => { + if self.line.is_empty() { + (self.callback_fn)(cx, &self.line, PromptEvent::Abort); + return close_fn; + } self.delete_char_backwards(cx.editor); (self.callback_fn)(cx, &self.line, PromptEvent::Update); }