diff options
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r-- | helix-term/src/ui/editor.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 92913701..00305fc8 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -527,7 +527,8 @@ impl EditorView { // count handling key!(i @ '0'..='9') => { let i = i.to_digit(10).unwrap() as usize; - cxt.editor.count = Some(cxt.editor.count.map_or(i, |c| c * 10 + i)); + cxt.editor.count = + std::num::NonZeroUsize::new(cxt.editor.count.map_or(i, |c| c.get() * 10 + i)); } // special handling for repeat operator key!('.') => { @@ -540,7 +541,7 @@ impl EditorView { } _ => { // set the count - cxt.count = cxt.editor.count.take().unwrap_or(1); + cxt._count = cxt.editor.count.take(); // TODO: edge case: 0j -> reset to 1 // if this fails, count was Some(0) // debug_assert!(cxt.count != 0); @@ -587,8 +588,8 @@ impl Component for EditorView { let mut cxt = commands::Context { register: helix_view::RegisterSelection::default(), - count: 1, editor: &mut cx.editor, + _count: None, callback: None, on_next_key_callback: None, callbacks: cx.callbacks, |