vim: Fix increment/decrement command (#17644)
Improving vim increment and decrement command. Closes: #16672 ## Release Notes: - vim: Improved edge-case handling for ctrl-a/ctrl-x --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
43e005e936
commit
c3f47b8040
7 changed files with 273 additions and 22 deletions
|
@ -0,0 +1,10 @@
|
|||
{"Put":{"state":"0b111111111111111111111111111111111111111111111111111111111111111111111ˇ1\n"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"0b000000111111111111111111111111111111111111111111111111111111111111111ˇ1\n", "mode":"Normal"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"0b000000000000000000000000000000000000000000000000000000000000000000000ˇ0\n","mode":"Normal"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"0b000000000000000000000000000000000000000000000000000000000000000000000ˇ1\n","mode":"Normal"}}
|
||||
{"Key":"2"}
|
||||
{"Key":"ctrl-x"}
|
||||
{"Get":{"state":"0b000000111111111111111111111111111111111111111111111111111111111111111ˇ1\n", "mode":"Normal"}}
|
5
crates/vim/test_data/test_increment_hex_casing.json
Normal file
5
crates/vim/test_data/test_increment_hex_casing.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{"Put":{"state":"0xFˇa\n"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"0xfˇb\n","mode":"Normal"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"0xfˇc\n","mode":"Normal"}}
|
|
@ -0,0 +1,10 @@
|
|||
{"Put":{"state":"0xfffffffffffffffffffˇf\n"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"0x0000fffffffffffffffˇf\n", "mode":"Normal"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"0x0000000000000000000ˇ0\n","mode":"Normal"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"0x0000000000000000000ˇ1\n","mode":"Normal"}}
|
||||
{"Key":"2"}
|
||||
{"Key":"ctrl-x"}
|
||||
{"Get":{"state":"0x0000fffffffffffffffˇf\n", "mode":"Normal"}}
|
10
crates/vim/test_data/test_increment_inline.json
Normal file
10
crates/vim/test_data/test_increment_inline.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{"Put":{"state":"inline0x3ˇ9u32\n"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"inline0x3ˇau32\n","mode":"Normal"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"inline0x3ˇbu32\n", "mode":"Normal"}}
|
||||
{"Key":"l"}
|
||||
{"Key":"l"}
|
||||
{"Key":"l"}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"inline0x3bu3ˇ3\n", "mode":"Normal"}}
|
6
crates/vim/test_data/test_increment_sign_change.json
Normal file
6
crates/vim/test_data/test_increment_sign_change.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{"Put":{"state":"ˇ0\n"}}
|
||||
{"Key":"ctrl-x"}
|
||||
{"Get":{"state":"-ˇ1\n","mode":"Normal"}}
|
||||
{"Key":"2"}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"ˇ1\n", "mode":"Normal"}}
|
13
crates/vim/test_data/test_increment_wrapping.json
Normal file
13
crates/vim/test_data/test_increment_wrapping.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{"Put":{"state":"1844674407370955161ˇ9\n"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"1844674407370955161ˇ5\n","mode":"Normal"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"-1844674407370955161ˇ5\n", "mode":"Normal"}}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"-1844674407370955161ˇ4\n", "mode":"Normal"}}
|
||||
{"Key":"3"}
|
||||
{"Key":"ctrl-x"}
|
||||
{"Get":{"state":"1844674407370955161ˇ4\n", "mode":"Normal"}}
|
||||
{"Key":"2"}
|
||||
{"Key":"ctrl-a"}
|
||||
{"Get":{"state":"-1844674407370955161ˇ5\n", "mode":"Normal"}}
|
Loading…
Add table
Add a link
Reference in a new issue