vim: Add basic mark support (#11507)
Release Notes: - vim: Added support for buffer-local marks (`'a-'z`) and some builtin marks `'<`,`'>`,`'[`,`']`, `'{`, `'}` and `^`. Global marks (`'A-'Z`), and other builtin marks (`'0-'9`, `'(`, `')`, `''`, `'.`, `'"`) are not yet implemented. (#5122) --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
9cef0ac869
commit
901cb8b3d2
14 changed files with 471 additions and 6 deletions
36
crates/vim/test_data/test_builtin_marks.json
Normal file
36
crates/vim/test_data/test_builtin_marks.json
Normal file
|
@ -0,0 +1,36 @@
|
|||
{"Put":{"state":"Line one\nLine two\nLine ˇthree\nLine four\nLine five\n"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"j"}
|
||||
{"Key":"escape"}
|
||||
{"Key":"k"}
|
||||
{"Key":"k"}
|
||||
{"Key":"'"}
|
||||
{"Key":"<"}
|
||||
{"Get":{"state":"Line one\nLine two\nˇLine three\nLine four\nLine five\n","mode":"Normal"}}
|
||||
{"Key":"`"}
|
||||
{"Key":"<"}
|
||||
{"Get":{"state":"Line one\nLine two\nLine ˇthree\nLine four\nLine five\n","mode":"Normal"}}
|
||||
{"Key":"'"}
|
||||
{"Key":">"}
|
||||
{"Get":{"state":"Line one\nLine two\nLine three\nˇLine four\nLine five\n","mode":"Normal"}}
|
||||
{"Key":"`"}
|
||||
{"Key":">"}
|
||||
{"Get":{"state":"Line one\nLine two\nLine three\nLine ˇfour\nLine five\n","mode":"Normal"}}
|
||||
{"Key":"g"}
|
||||
{"Key":"g"}
|
||||
{"Key":"^"}
|
||||
{"Key":"j"}
|
||||
{"Key":"j"}
|
||||
{"Key":"l"}
|
||||
{"Key":"l"}
|
||||
{"Key":"c"}
|
||||
{"Key":"e"}
|
||||
{"Key":"k"}
|
||||
{"Key":"e"}
|
||||
{"Key":"escape"}
|
||||
{"Key":"'"}
|
||||
{"Key":"."}
|
||||
{"Get":{"state":"Line one\nLine two\nˇLike three\nLine four\nLine five\n","mode":"Normal"}}
|
||||
{"Key":"`"}
|
||||
{"Key":"."}
|
||||
{"Get":{"state":"Line one\nLine two\nLiˇke three\nLine four\nLine five\n","mode":"Normal"}}
|
26
crates/vim/test_data/test_caret_mark.json
Normal file
26
crates/vim/test_data/test_caret_mark.json
Normal file
|
@ -0,0 +1,26 @@
|
|||
{"Put":{"state":"Line one\nLine two\nLine three\nˇLine four\nLine five\n"}}
|
||||
{"Key":"c"}
|
||||
{"Key":"w"}
|
||||
{"Key":"shift-s"}
|
||||
{"Key":"t"}
|
||||
{"Key":"r"}
|
||||
{"Key":"a"}
|
||||
{"Key":"i"}
|
||||
{"Key":"g"}
|
||||
{"Key":"h"}
|
||||
{"Key":"t"}
|
||||
{"Key":" "}
|
||||
{"Key":"t"}
|
||||
{"Key":"h"}
|
||||
{"Key":"i"}
|
||||
{"Key":"n"}
|
||||
{"Key":"g"}
|
||||
{"Key":"escape"}
|
||||
{"Key":"j"}
|
||||
{"Key":"j"}
|
||||
{"Key":"'"}
|
||||
{"Key":"^"}
|
||||
{"Get":{"state":"Line one\nLine two\nLine three\nˇStraight thing four\nLine five\n","mode":"Normal"}}
|
||||
{"Key":"`"}
|
||||
{"Key":"^"}
|
||||
{"Get":{"state":"Line one\nLine two\nLine three\nStraight thingˇ four\nLine five\n","mode":"Normal"}}
|
15
crates/vim/test_data/test_lowercase_marks.json
Normal file
15
crates/vim/test_data/test_lowercase_marks.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{"Put":{"state":"line one\nline ˇtwo\nline three"}}
|
||||
{"Key":"m"}
|
||||
{"Key":"a"}
|
||||
{"Key":"l"}
|
||||
{"Key":"'"}
|
||||
{"Key":"a"}
|
||||
{"Get":{"state":"line one\nˇline two\nline three","mode":"Normal"}}
|
||||
{"Key":"`"}
|
||||
{"Key":"a"}
|
||||
{"Get":{"state":"line one\nline ˇtwo\nline three","mode":"Normal"}}
|
||||
{"Key":"^"}
|
||||
{"Key":"d"}
|
||||
{"Key":"`"}
|
||||
{"Key":"a"}
|
||||
{"Get":{"state":"line one\nˇtwo\nline three","mode":"Normal"}}
|
18
crates/vim/test_data/test_lt_gt_marks.json
Normal file
18
crates/vim/test_data/test_lt_gt_marks.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{"Put":{"state":"Line one\nLine two\nLine ˇthree\nLine four\nLine five\n"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"j"}
|
||||
{"Key":"escape"}
|
||||
{"Key":"k"}
|
||||
{"Key":"k"}
|
||||
{"Key":"'"}
|
||||
{"Key":"<"}
|
||||
{"Get":{"state":"Line one\nLine two\nˇLine three\nLine four\nLine five\n","mode":"Normal"}}
|
||||
{"Key":"`"}
|
||||
{"Key":"<"}
|
||||
{"Get":{"state":"Line one\nLine two\nLine ˇthree\nLine four\nLine five\n","mode":"Normal"}}
|
||||
{"Key":"'"}
|
||||
{"Key":">"}
|
||||
{"Get":{"state":"Line one\nLine two\nLine three\nˇLine four\nLine five\n","mode":"Normal"}}
|
||||
{"Key":"`"}
|
||||
{"Key":">"}
|
||||
{"Get":{"state":"Line one\nLine two\nLine three\nLine ˇfour\nLine five\n","mode":"Normal"}}
|
15
crates/vim/test_data/test_marks.json
Normal file
15
crates/vim/test_data/test_marks.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{"Put":{"state":"line one\nline ˇtwo\nline three"}}
|
||||
{"Key":"m"}
|
||||
{"Key":"a"}
|
||||
{"Key":"l"}
|
||||
{"Key":"'"}
|
||||
{"Key":"a"}
|
||||
{"Get":{"state":"line one\nˇline two\nline three","mode":"Normal"}}
|
||||
{"Key":"`"}
|
||||
{"Key":"a"}
|
||||
{"Get":{"state":"line one\nline ˇtwo\nline three","mode":"Normal"}}
|
||||
{"Key":"^"}
|
||||
{"Key":"d"}
|
||||
{"Key":"`"}
|
||||
{"Key":"a"}
|
||||
{"Get":{"state":"line one\nˇtwo\nline three","mode":"Normal"}}
|
14
crates/vim/test_data/test_period_mark.json
Normal file
14
crates/vim/test_data/test_period_mark.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{"Put":{"state":"Line one\nLine two\nLiˇne three\nLine four\nLine five\n"}}
|
||||
{"Key":"c"}
|
||||
{"Key":"e"}
|
||||
{"Key":"k"}
|
||||
{"Key":"e"}
|
||||
{"Key":"escape"}
|
||||
{"Key":"j"}
|
||||
{"Key":"j"}
|
||||
{"Key":"'"}
|
||||
{"Key":"."}
|
||||
{"Get":{"state":"Line one\nLine two\nˇLike three\nLine four\nLine five\n","mode":"Normal"}}
|
||||
{"Key":"`"}
|
||||
{"Key":"."}
|
||||
{"Get":{"state":"Line one\nLine two\nLiˇke three\nLine four\nLine five\n","mode":"Normal"}}
|
Loading…
Add table
Add a link
Reference in a new issue