aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authoradaliaramon2022-04-20 01:50:13 +0000
committerGitHub2022-04-20 01:50:13 +0000
commit94eba0e66aa193c093b1d7eefc0e21391cb2485f (patch)
tree269574d5516915691779dbaeba52c31b166186e5 /helix-term/src/ui
parent2a853cd41dd15d2891ac6ca17372c9f5f00a8528 (diff)
Added ability to remap 0 if it is not part of a count (#2174)
* Added ability to remap 0 * Removed duplicated match body
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/editor.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index fc8b6470..318180d7 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -774,15 +774,15 @@ impl EditorView {
}
fn command_mode(&mut self, mode: Mode, cxt: &mut commands::Context, event: KeyEvent) {
- match event {
+ match (event, cxt.editor.count) {
// count handling
- key!(i @ '0'..='9') => {
+ (key!(i @ '0'), Some(_)) | (key!(i @ '1'..='9'), _) => {
let i = i.to_digit(10).unwrap() as usize;
cxt.editor.count =
std::num::NonZeroUsize::new(cxt.editor.count.map_or(i, |c| c.get() * 10 + i));
}
// special handling for repeat operator
- key!('.') if self.keymaps.pending().is_empty() => {
+ (key!('.'), _) if self.keymaps.pending().is_empty() => {
// first execute whatever put us into insert mode
self.last_insert.0.execute(cxt);
// then replay the inputs