mirror of
https://github.com/helix-editor/helix
synced 2024-06-03 08:26:10 +02:00
helix-term: allow to backspace out-of the command prompt (#9828)
This commit is contained in:
parent
e3c6c82828
commit
0dc67ff885
|
@ -544,6 +544,10 @@ fn handle_event(&mut self, event: &Event, cx: &mut Context) -> EventResult {
|
||||||
(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…
Reference in New Issue