diff --git a/src/input.rs b/src/input.rs index 7b453ea..ca20d29 100644 --- a/src/input.rs +++ b/src/input.rs @@ -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);