Fix vim full line operations failing when no trailing newline (#24409)

Closes #24270

Release Notes:

- Fixed an issue where doing line-wise operations in vim mode on the
last line of a file with no trailing newline would not work properly
This commit is contained in:
Ben Kunkle 2025-02-06 17:57:24 -06:00 committed by GitHub
parent 73c487c222
commit 337b9e62d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 79 additions and 17 deletions

View file

@ -0,0 +1,7 @@
{"Put":{"state":"heˇllo"}}
{"Key":"d"}
{"Key":"d"}
{"Get":{"state":"ˇ","mode":"Normal"}}
{"Key":"p"}
{"Key":"p"}
{"Get":{"state":"\nhello\nˇhello","mode":"Normal"}}

View file

@ -1,10 +1,10 @@
{"Put":{"state":"0b111111111111111111111111111111111111111111111111111111111111111111111ˇ1\n"}}
{"Key":"ctrl-a"}
{"Get":{"state":"0b000000111111111111111111111111111111111111111111111111111111111111111ˇ1\n", "mode":"Normal"}}
{"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"}}
{"Get":{"state":"0b000000111111111111111111111111111111111111111111111111111111111111111ˇ1\n","mode":"Normal"}}

View file

@ -1,10 +1,10 @@
{"Put":{"state":"0xfffffffffffffffffffˇf\n"}}
{"Key":"ctrl-a"}
{"Get":{"state":"0x0000fffffffffffffffˇf\n", "mode":"Normal"}}
{"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"}}
{"Get":{"state":"0x0000fffffffffffffffˇf\n","mode":"Normal"}}

View file

@ -2,9 +2,9 @@
{"Key":"ctrl-a"}
{"Get":{"state":"inline0x3ˇau32\n","mode":"Normal"}}
{"Key":"ctrl-a"}
{"Get":{"state":"inline0x3ˇbu32\n", "mode":"Normal"}}
{"Get":{"state":"inline0x3ˇbu32\n","mode":"Normal"}}
{"Key":"l"}
{"Key":"l"}
{"Key":"l"}
{"Key":"ctrl-a"}
{"Get":{"state":"inline0x3bu3ˇ3\n", "mode":"Normal"}}
{"Get":{"state":"inline0x3bu3ˇ3\n","mode":"Normal"}}

View file

@ -3,4 +3,4 @@
{"Get":{"state":"-ˇ1\n","mode":"Normal"}}
{"Key":"2"}
{"Key":"ctrl-a"}
{"Get":{"state":"ˇ1\n", "mode":"Normal"}}
{"Get":{"state":"ˇ1\n","mode":"Normal"}}

View file

@ -2,12 +2,12 @@
{"Key":"ctrl-a"}
{"Get":{"state":"1844674407370955161ˇ5\n","mode":"Normal"}}
{"Key":"ctrl-a"}
{"Get":{"state":"-1844674407370955161ˇ5\n", "mode":"Normal"}}
{"Get":{"state":"-1844674407370955161ˇ5\n","mode":"Normal"}}
{"Key":"ctrl-a"}
{"Get":{"state":"-1844674407370955161ˇ4\n", "mode":"Normal"}}
{"Get":{"state":"-1844674407370955161ˇ4\n","mode":"Normal"}}
{"Key":"3"}
{"Key":"ctrl-x"}
{"Get":{"state":"1844674407370955161ˇ4\n", "mode":"Normal"}}
{"Get":{"state":"1844674407370955161ˇ4\n","mode":"Normal"}}
{"Key":"2"}
{"Key":"ctrl-a"}
{"Get":{"state":"-1844674407370955161ˇ5\n", "mode":"Normal"}}
{"Get":{"state":"-1844674407370955161ˇ5\n","mode":"Normal"}}

View file

@ -0,0 +1,5 @@
{"Put":{"state":"heˇllo\n"}}
{"Key":"y"}
{"Key":"y"}
{"Key":"p"}
{"Get":{"state":"hello\nˇhello\n","mode":"Normal"}}

View file

@ -0,0 +1,5 @@
{"Put":{"state":"heˇllo"}}
{"Key":"y"}
{"Key":"y"}
{"Key":"p"}
{"Get":{"state":"hello\nˇhello","mode":"Normal"}}

View file

@ -0,0 +1,6 @@
{"Put":{"state":"heˇllo\nhello"}}
{"Key":"2"}
{"Key":"y"}
{"Key":"y"}
{"Key":"p"}
{"Get":{"state":"hello\nˇhello\nhello\nhello","mode":"Normal"}}