text_box: Do not attempt to insert control characters

This commit is contained in:
Jeremy Soller 2023-11-08 11:45:46 -07:00
parent a71166383a
commit 02a093be0e
No known key found for this signature in database
GPG key ID: DCFCA852D3906975

View file

@ -431,11 +431,8 @@ where
Event::Keyboard(KeyEvent::CharacterReceived(character)) => {
// Only parse keys when Super, Ctrl, and Alt are not pressed
if !state.modifiers.logo() && !state.modifiers.control() && !state.modifiers.alt() {
match character {
'\n' | '\r' | '\t' => {}
_ => {
editor.action(Action::Insert(character));
}
if !character.is_control() {
editor.action(Action::Insert(character));
}
status = Status::Captured;
}