mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-09-11 16:07:00 +03:00
ui: prompt: Fix typing with alt
This commit is contained in:
parent
46f537d4ce
commit
5cee3b634d
@ -400,18 +400,6 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
|
||||
})));
|
||||
|
||||
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 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
|
||||
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);
|
||||
}
|
||||
_ => (),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user