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:
parent
df57754baf
commit
8e8a772c2d
7 changed files with 303 additions and 8 deletions
14
crates/vim/test_data/test_undo_last_line.json
Normal file
14
crates/vim/test_data/test_undo_last_line.json
Normal 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"}}
|
15
crates/vim/test_data/test_undo_last_line_newline.json
Normal file
15
crates/vim/test_data/test_undo_last_line_newline.json
Normal 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"}
|
|
@ -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"}}
|
Loading…
Add table
Add a link
Reference in a new issue