aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-08-27 07:39:21 +0000
committerBlaž Hrastnik2021-08-27 07:39:52 +0000
commit5cee3b634d3763dfdb0312d1dc58f6ebcfccb4bf (patch)
treec5ab11064a669ed5f1f7a9601cf3206c45bb3d60 /helix-term
parent46f537d4ce0ae9c8f0be8d89f97c3fbe68afabd5 (diff)
ui: prompt: Fix typing with alt
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/prompt.rs20
1 files changed, 8 insertions, 12 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index 19986b5c..7197adea 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -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,
@@ -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);
+ }
_ => (),
};