Skip to content

Commit

Permalink
ui: prompt: Fix typing with alt
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Aug 27, 2021
1 parent 46f537d commit 5cee3b6
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions helix-term/src/ui/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,18 +400,6 @@ impl Component for Prompt {
})));

match event {
// char or shift char
KeyEvent {
code: KeyCode::Char(c),
modifiers: KeyModifiers::NONE,
}
| KeyEvent {
code: KeyCode::Char(c),
modifiers: KeyModifiers::SHIFT,
} => {
self.insert_char(c);
(self.callback_fn)(cx, &self.line, PromptEvent::Update);
}
KeyEvent {
code: KeyCode::Char('c'),
modifiers: KeyModifiers::CONTROL,
Expand Down Expand Up @@ -539,6 +527,14 @@ impl Component for Prompt {
code: KeyCode::Char('q'),
modifiers: KeyModifiers::CONTROL,
} => self.exit_selection(),
// any char event that's not combined with control or mapped to any other combo
KeyEvent {
code: KeyCode::Char(c),
modifiers,
} if !modifiers.contains(KeyModifiers::CONTROL) => {
self.insert_char(c);
(self.callback_fn)(cx, &self.line, PromptEvent::Update);
}
_ => (),
};

Expand Down

0 comments on commit 5cee3b6

Please sign in to comment.