on master help sign in
fix: prompt: pass through unmapped keys regardless of modifiers

Ctrl + Alt is apparently another common sequence for AltGr: https://devblogs.microsoft.com/oldnewthing/20040329-00/?p=40003 Fixes #595 Fixes #2080

commit764adbdcf6f0a5615d1ddd3abb7ed7b9cf0f2d92 authorBlaž Hrastnik <blaz@mxxn.io> dateWed 13 Apr 2022, 15:17 (5 years ago) parent4836bb3
1 file changed+4−4
helix-term/src/ui/prompt.rs+4−4
helix-term/src/ui/prompt.rs+4−4
@@ -2,7 +2,7 @@ use crate::compositor::{Component, Compositor, Context, EventResult};
22use crate::{alt, ctrl, key, shift, ui};
33use crossterm::event::Event;
44use helix_view::input::KeyEvent;
5−use helix_view::keyboard::{KeyCode, KeyModifiers};
5+use helix_view::keyboard::KeyCode;
66use std::{borrow::Cow, ops::RangeFrom};
77use tui::buffer::Buffer as Surface;
88use tui::widgets::{Block, Borders, Widget};
@@ -529,11 +529,11 @@ impl Component for Prompt {
529529 (self.callback_fn)(cx, &self.line, PromptEvent::Update)
530530 }
531531 ctrl!('q') => self.exit_selection(),
532− // any char event that's not combined with control or mapped to any other combo
532+ // any char event that's not mapped to any other combo
533533 KeyEvent {
534534 code: KeyCode::Char(c),
535− modifiers,
536− } if !modifiers.contains(KeyModifiers::CONTROL) => {
535+ modifiers: _,
536+ } => {
537537 self.insert_char(c, cx);
538538 (self.callback_fn)(cx, &self.line, PromptEvent::Update);
539539 }