From 3e21648951e28501327b6172c7a5c10832417ad0 Mon Sep 17 00:00:00 2001 From: Huy Tran Date: Wed, 10 Apr 2024 02:40:23 -0700 Subject: [PATCH] fix: New word for control characters --- src/main.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index e9954d3..c7bdabd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -184,10 +184,7 @@ fn event_handler( INPUT_STATE.new_word(); } else { // Otherwise, process the character - if modifiers.is_super() - || modifiers.is_control() - || modifiers.is_alt() - { + if modifiers.is_super() || modifiers.is_alt() { INPUT_STATE.new_word(); } else if INPUT_STATE.is_tracking() { INPUT_STATE.push( @@ -209,7 +206,11 @@ fn event_handler( KEY_ENTER | KEY_TAB | KEY_SPACE | KEY_ESCAPE => { INPUT_STATE.new_word(); } - _ => {} + _ => { + if !modifiers.is_empty() { + INPUT_STATE.new_word(); + } + } } } }