feat: clear char queue on Esc

This commit is contained in:
Jeremy Wall 2024-12-28 10:49:28 -05:00
parent c33739babe
commit 704f9f7746

View File

@ -652,6 +652,7 @@ impl<'ws> Workspace<'ws> {
match key.code { match key.code {
KeyCode::Esc => { KeyCode::Esc => {
self.state.reset_n_prefix(); self.state.reset_n_prefix();
self.state.char_queue.clear();
} }
KeyCode::Char(d) if d.is_ascii_digit() => { KeyCode::Char(d) if d.is_ascii_digit() => {
self.handle_numeric_prefix(d); self.handle_numeric_prefix(d);
@ -727,12 +728,6 @@ impl<'ws> Workspace<'ws> {
Ok(()) Ok(())
})?; })?;
} }
KeyCode::Char('s')
if key.modifiers == KeyModifiers::HYPER
|| key.modifiers == KeyModifiers::SUPER =>
{
self.save_file()?;
}
KeyCode::Char('l') if key.modifiers == KeyModifiers::CONTROL => { KeyCode::Char('l') if key.modifiers == KeyModifiers::CONTROL => {
self.run_with_prefix(|ws: &mut Workspace<'_>| -> Result<()> { self.run_with_prefix(|ws: &mut Workspace<'_>| -> Result<()> {
let Address { row: _, col } = &ws.book.location; let Address { row: _, col } = &ws.book.location;