vim: Add U to undo last line (#33571)

Closes #14760

Still TODO:

* Vim actually undoes *many* changes if they're all on the same line.

Release Notes:

- vim: Add `U` to return to the last changed line and undo
This commit is contained in:
Conrad Irwin 2025-07-08 21:24:43 -06:00 committed by GitHub
parent df57754baf
commit 8e8a772c2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 303 additions and 8 deletions

View file

@ -0,0 +1,14 @@
{"Put":{"state":"ˇfn a() { }\nfn a() { }\nfn a() { }\n"}}
{"Key":"shift-g"}
{"Get":{"state":"fn a() { }\nfn a() { }\nfn a() { }\nˇ","mode":"Normal"}}
{"Key":"r"}
{"Key":"a"}
{"Get":{"state":"fn a() { }\nfn a() { }\nfn a() { }\nˇ","mode":"Normal"}}
{"Key":"shift-u"}
{"Get":{"state":"ˇ\nfn a() { }\nfn a() { }\n","mode":"Normal"}}
{"Key":"shift-u"}
{"Get":{"state":"ˇfn a() { }\nfn a() { }\nfn a() { }\n","mode":"Normal"}}
{"Key":"g"}
{"Key":"g"}
{"Key":"shift-u"}
{"Get":{"state":"ˇ\nfn a() { }\nfn a() { }\n","mode":"Normal"}}

View file

@ -0,0 +1,15 @@
{"Put":{"state":"ˇfn a() { }\nfn a() { }\nfn a() { }\n"}}
{"Key":"shift-g"}
{"Key":"k"}
{"Get":{"state":"fn a() { }\nfn a() { }\nˇfn a() { }\n","mode":"Normal"}}
{"Key":"o"}
{"Key":"h"}
{"Key":"e"}
{"Key":"l"}
{"Key":"l"}
{"Key":"o"}
{"Key":"escape"}
{"Get":{"state":"fn a() { }\nfn a() { }\nfn a() { }\nhellˇo\n","mode":"Normal"}}
{"Key":"shift-u"}
{"Get":{"state":"fn a() { }\nfn a() { }\nfn a() { }\nˇ\n","mode":"Normal"}}
{"Key":"shift-u"}

View file

@ -0,0 +1,21 @@
{"Put":{"state":"ˇfn a() { }\nfn a() { }\nfn a() { }\n"}}
{"Key":"x"}
{"Key":"shift-g"}
{"Key":"k"}
{"Get":{"state":"n a() { }\nfn a() { }\nˇfn a() { }\n","mode":"Normal"}}
{"Key":"x"}
{"Key":"f"}
{"Key":"a"}
{"Key":"x"}
{"Key":"f"}
{"Key":"{"}
{"Key":"x"}
{"Get":{"state":"n a() { }\nfn a() { }\nn () ˇ }\n","mode":"Normal"}}
{"Key":"shift-u"}
{"Get":{"state":"n a() { }\nfn a() { }\nˇfn a() { }\n","mode":"Normal"}}
{"Key":"shift-u"}
{"Get":{"state":"n a() { }\nfn a() { }\nn () ˇ }\n","mode":"Normal"}}
{"Key":"shift-u"}
{"Get":{"state":"n a() { }\nfn a() { }\nˇfn a() { }\n","mode":"Normal"}}
{"Key":"shift-u"}
{"Get":{"state":"n a() { }\nfn a() { }\nn () ˇ }\n","mode":"Normal"}}