helix-term: allow to backspace out-of the command prompt (#9828)

pull/9839/head
Markus F.X.J. Oberhumer 9 months ago committed by GitHub
parent e3c6c82828
commit 0dc67ff885
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -544,6 +544,10 @@ impl Component for Prompt {
(self.callback_fn)(cx, &self.line, PromptEvent::Update); (self.callback_fn)(cx, &self.line, PromptEvent::Update);
} }
ctrl!('h') | key!(Backspace) | shift!(Backspace) => { 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.delete_char_backwards(cx.editor);
(self.callback_fn)(cx, &self.line, PromptEvent::Update); (self.callback_fn)(cx, &self.line, PromptEvent::Update);
} }

Loading…
Cancel
Save