Skip to content

Commit

Permalink
fix: Only track if the typing buffer starts with non-numeric characters
Browse files Browse the repository at this point in the history
Fixes #120
  • Loading branch information
huytd committed Jun 3, 2024
1 parent cd2bec7 commit bfe5f6e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@ impl InputState {
}

pub fn push(&mut self, c: char) {
if let Some(first_char) = self.buffer.chars().next() {
if first_char.is_numeric() {
self.buffer.remove(0);
self.display_buffer.remove(0);
}
}
if self.buffer.len() <= MAX_POSSIBLE_WORD_LENGTH {
self.buffer.push(c);
self.display_buffer.push(c);
Expand Down

0 comments on commit bfe5f6e

Please sign in to comment.