Skip to content

Commit

Permalink
fix: New word for control characters
Browse files Browse the repository at this point in the history
  • Loading branch information
huytd committed Apr 10, 2024
1 parent 9edb40b commit 3e21648
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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();
}
}
}
}
}
Expand Down

0 comments on commit 3e21648

Please sign in to comment.