-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
43e005e
commit c3f47b8
Showing
7 changed files
with
273 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
crates/vim/test_data/test_increment_bin_wrapping_and_padding.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}} |
10 changes: 10 additions & 0 deletions
10
crates/vim/test_data/test_increment_hex_wrapping_and_padding.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}} |