aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-04-13 06:17:44 +0000
committerBlaž Hrastnik2022-04-13 06:19:42 +0000
commit764adbdcf6f0a5615d1ddd3abb7ed7b9cf0f2d92 (patch)
tree8ef6dfc7294239599aedd5f4d43945dfd2baef5b
parent4836bb38d3c13c9f1ebd3533bc35a54f80c7e118 (diff)
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
-rw-r--r--helix-term/src/ui/prompt.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index 4daa33e5..bd78ba63 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -2,7 +2,7 @@ use crate::compositor::{Component, Compositor, Context, EventResult};
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 @@ impl Component for Prompt {
(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);
}