Skip to content

Commit

Permalink
fix: prompt: pass through unmapped keys regardless of modifiers
Browse files Browse the repository at this point in the history
Ctrl + Alt is apparently another common sequence for AltGr:
https://devblogs.microsoft.com/oldnewthing/20040329-00/?p=40003

Fixes #595
Fixes #2080
  • Loading branch information
archseer committed Apr 13, 2022
1 parent 4836bb3 commit 764adbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions helix-term/src/ui/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 764adbd

Please sign in to comment.