on master help sign in
Fix #6669: Theme preview doesn't return theme to normal (#6694)

* Fix #6669: Theme preview doesn't return theme to normal when delete name with Alt-Backspace * Fix #6669: Return theme preview to normal theme for all remaining keybinds that change the promt text

commit9f680c69f42c239c8b01eba65a1c1e2dec7f7295 authorshem <vsv@scade.io> dateThu 13 Apr 2023, 01:43 (4 years ago) parent161fef2
1 file changed+14−4
helix-term/src/ui/prompt.rs+14−4
helix-term/src/ui/prompt.rs+14−4
@@ -511,11 +511,21 @@ impl Component for Prompt {
511511 ctrl!('e') | key!(End) => self.move_end(),
512512 ctrl!('a') | key!(Home) => self.move_start(),
513513 ctrl!('w') | alt!(Backspace) | ctrl!(Backspace) => {
514− self.delete_word_backwards(cx.editor)
514+ self.delete_word_backwards(cx.editor);
515+ (self.callback_fn)(cx, &self.line, PromptEvent::Update);
516+ }
517+ alt!('d') | alt!(Delete) | ctrl!(Delete) => {
518+ self.delete_word_forwards(cx.editor);
519+ (self.callback_fn)(cx, &self.line, PromptEvent::Update);
520+ }
521+ ctrl!('k') => {
522+ self.kill_to_end_of_line(cx.editor);
523+ (self.callback_fn)(cx, &self.line, PromptEvent::Update);
524+ }
525+ ctrl!('u') => {
526+ self.kill_to_start_of_line(cx.editor);
527+ (self.callback_fn)(cx, &self.line, PromptEvent::Update);
515528 }
516− alt!('d') | alt!(Delete) | ctrl!(Delete) => self.delete_word_forwards(cx.editor),
517− ctrl!('k') => self.kill_to_end_of_line(cx.editor),
518− ctrl!('u') => self.kill_to_start_of_line(cx.editor),
519529 ctrl!('h') | key!(Backspace) | shift!(Backspace) => {
520530 self.delete_char_backwards(cx.editor);
521531 (self.callback_fn)(cx, &self.line, PromptEvent::Update);