mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
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
This commit is contained in:
parent
4836bb38d3
commit
764adbdcf6
@ -2,7 +2,7 @@
|
||||
use crate::{alt, ctrl, key, shift, ui};
|
||||
use crossterm::event::Event;
|
||||
use helix_view::input::KeyEvent;
|
||||
use helix_view::keyboard::{KeyCode, KeyModifiers};
|
||||
use helix_view::keyboard::KeyCode;
|
||||
use std::{borrow::Cow, ops::RangeFrom};
|
||||
use tui::buffer::Buffer as Surface;
|
||||
use tui::widgets::{Block, Borders, Widget};
|
||||
@ -529,11 +529,11 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
|
||||
(self.callback_fn)(cx, &self.line, PromptEvent::Update)
|
||||
}
|
||||
ctrl!('q') => self.exit_selection(),
|
||||
// any char event that's not combined with control or mapped to any other combo
|
||||
// any char event that's not mapped to any other combo
|
||||
KeyEvent {
|
||||
code: KeyCode::Char(c),
|
||||
modifiers,
|
||||
} if !modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
modifiers: _,
|
||||
} => {
|
||||
self.insert_char(c, cx);
|
||||
(self.callback_fn)(cx, &self.line, PromptEvent::Update);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user