@@ -9,7 +9,7 @@ use std::borrow::Cow;
10use crossterm::{
10use crossterm::{
12− event::{read, Event, EventStream, KeyCode, KeyEvent},
12+ event::{read, Event, EventStream, KeyCode, KeyEvent, KeyModifiers},
15 backend::CrosstermBackend,
15 backend::CrosstermBackend,
@@ -333,10 +333,27 @@ impl Component for EditorView {
335 mode => {
335 mode => {
336+ match keys.as_slice() {
338+ code: KeyCode::Char(i @ '0'..='9'),
339+ modifiers: KeyModifiers::NONE,
341+ let i = i.to_digit(10).unwrap() as usize;
342+ cxt.editor.count = Some(cxt.editor.count.map_or(i, |c| c * 10 + i));
346+ cxt.count = cxt.editor.count.take().unwrap_or(1);
347+ // TODO: edge case: 0j -> reset to 1
348+ // if this fails, count was Some(0)
349+ // debug_assert!(cxt.count != 0);
336− if let Some(command) = self.keymap[&mode].get(&keys) {
351+ if let Some(command) = self.keymap[&mode].get(&keys) {
337− command(&mut cxt);
352+ command(&mut cxt);
339− // TODO: simplistic ensure cursor in view for now
354+ // TODO: simplistic ensure cursor in view for now