Skip to content

Commit

Permalink
helix-term: allow to backspace out-of the command prompt (helix-edito…
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-oberhumer-forks authored and mtoohey31 committed Jun 2, 2024
1 parent e74ffb6 commit 9b6df99
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helix-term/src/ui/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9b6df99

Please sign in to comment.