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 chrisshort-udig committed Mar 31, 2024
1 parent 8e9db88 commit 3a5f116
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 3a5f116

Please sign in to comment.