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:
hekmyr 2024-09-19 02:28:31 +02:00 committed by GitHub
parent 43e005e936
commit c3f47b8040
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 273 additions and 22 deletions

View file

@ -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"}}

View 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"}}

View file

@ -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"}}

View 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"}}

View 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"}}

View 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"}}