Rewrite paste
- vim: support P for paste before - vim: support P in visual mode for paste without overriding clipboard - vim: fix position when using `p` on text copied outside zed - vim: fix indentation when using `p` on text copied from zed
This commit is contained in:
parent
31db5e4f62
commit
33d7fe02ee
14 changed files with 779 additions and 376 deletions
|
@ -1,13 +0,0 @@
|
|||
{"Put":{"state":"The quick brown\nfox juˇmps over\nthe lazy dog"}}
|
||||
{"Key":"d"}
|
||||
{"Key":"d"}
|
||||
{"Get":{"state":"The quick brown\nthe laˇzy dog","mode":"Normal"}}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"The quick brown\nthe lazy dog\nˇfox jumps over","mode":"Normal"}}
|
||||
{"Put":{"state":"The quick brown\nfox ˇjumps over\nthe lazy dog"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"w"}
|
||||
{"Key":"y"}
|
||||
{"Put":{"state":"The quick brown\nfox jumps oveˇr\nthe lazy dog"}}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"The quick brown\nfox jumps overjumps ˇo\nthe lazy dog","mode":"Normal"}}
|
31
crates/vim/test_data/test_paste.json
Normal file
31
crates/vim/test_data/test_paste.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{"Put":{"state":"The quick brown\nfox ˇjumps over\nthe lazy dog"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"w"}
|
||||
{"Key":"y"}
|
||||
{"ReadRegister":{"name":"\"","value":"jumps o"}}
|
||||
{"Put":{"state":"The quick brown\nfox jumps oveˇr\nthe lazy dog"}}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"The quick brown\nfox jumps overjumps ˇo\nthe lazy dog","mode":"Normal"}}
|
||||
{"Put":{"state":"The quick brown\nfox jumps oveˇr\nthe lazy dog"}}
|
||||
{"Key":"shift-p"}
|
||||
{"Get":{"state":"The quick brown\nfox jumps ovejumps ˇor\nthe lazy dog","mode":"Normal"}}
|
||||
{"Put":{"state":"The quick brown\nfox juˇmps over\nthe lazy dog"}}
|
||||
{"Key":"d"}
|
||||
{"Key":"d"}
|
||||
{"ReadRegister":{"name":"\"","value":"fox jumps over\n"}}
|
||||
{"Get":{"state":"The quick brown\nthe laˇzy dog","mode":"Normal"}}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"The quick brown\nthe lazy dog\nˇfox jumps over","mode":"Normal"}}
|
||||
{"Key":"k"}
|
||||
{"Key":"shift-p"}
|
||||
{"Get":{"state":"The quick brown\nˇfox jumps over\nthe lazy dog\nfox jumps over","mode":"Normal"}}
|
||||
{"Put":{"state":"The quick brown\nfox jumps ˇover\nthe lazy dog"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"j"}
|
||||
{"Key":"y"}
|
||||
{"ReadRegister":{"name":"\"","value":"over\nthe lazy do"}}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"The quick brown\nfox jumps oˇover\nthe lazy dover\nthe lazy dog","mode":"Normal"}}
|
||||
{"Key":"u"}
|
||||
{"Key":"shift-p"}
|
||||
{"Get":{"state":"The quick brown\nfox jumps ˇover\nthe lazy doover\nthe lazy dog","mode":"Normal"}}
|
42
crates/vim/test_data/test_paste_visual.json
Normal file
42
crates/vim/test_data/test_paste_visual.json
Normal file
|
@ -0,0 +1,42 @@
|
|||
{"Put":{"state":"The quick brown\nfox jˇumps over\nthe lazy dog"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"i"}
|
||||
{"Key":"w"}
|
||||
{"Key":"y"}
|
||||
{"Get":{"state":"The quick brown\nfox ˇjumps over\nthe lazy dog","mode":"Normal"}}
|
||||
{"Key":"w"}
|
||||
{"Key":"v"}
|
||||
{"Key":"i"}
|
||||
{"Key":"w"}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"The quick brown\nfox jumps jumpˇs\nthe lazy dog","mode":"Normal"}}
|
||||
{"ReadRegister":{"name":"\"","value":"over"}}
|
||||
{"Key":"up"}
|
||||
{"Key":"shift-v"}
|
||||
{"Key":"shift-p"}
|
||||
{"Get":{"state":"ˇover\nfox jumps jumps\nthe lazy dog","mode":"Normal"}}
|
||||
{"ReadRegister":{"name":"\"","value":"over"}}
|
||||
{"Key":"ctrl-v"}
|
||||
{"Key":"down"}
|
||||
{"Key":"down"}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"oveˇrver\noverox jumps jumps\noverhe lazy dog","mode":"Normal"}}
|
||||
{"Put":{"state":"The quick brown\nfox juˇmps over\nthe lazy dog"}}
|
||||
{"Key":"shift-v"}
|
||||
{"Key":"d"}
|
||||
{"Get":{"state":"The quick brown\nthe laˇzy dog","mode":"Normal"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"i"}
|
||||
{"Key":"w"}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"The quick brown\nthe \nˇfox jumps over\n dog","mode":"Normal"}}
|
||||
{"ReadRegister":{"name":"\"","value":"lazy"}}
|
||||
{"Put":{"state":"The quick brown\nfox juˇmps over\nthe lazy dog"}}
|
||||
{"Key":"shift-v"}
|
||||
{"Key":"d"}
|
||||
{"Get":{"state":"The quick brown\nthe laˇzy dog","mode":"Normal"}}
|
||||
{"Key":"k"}
|
||||
{"Key":"shift-v"}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"ˇfox jumps over\nthe lazy dog","mode":"Normal"}}
|
||||
{"ReadRegister":{"name":"\"","value":"The quick brown\n"}}
|
31
crates/vim/test_data/test_paste_visual_block.json
Normal file
31
crates/vim/test_data/test_paste_visual_block.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{"Put":{"state":"The ˇquick brown\nfox jumps over\nthe lazy dog"}}
|
||||
{"Key":"ctrl-v"}
|
||||
{"Key":"2"}
|
||||
{"Key":"j"}
|
||||
{"Key":"y"}
|
||||
{"ReadRegister":{"name":"\"","value":"q\nj\nl"}}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"The qˇquick brown\nfox jjumps over\nthe llazy dog","mode":"Normal"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"i"}
|
||||
{"Key":"w"}
|
||||
{"Key":"shift-p"}
|
||||
{"Get":{"state":"The ˇq brown\nfox jjjumps over\nthe lllazy dog","mode":"Normal"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"i"}
|
||||
{"Key":"w"}
|
||||
{"Key":"shift-p"}
|
||||
{"Put":{"state":"The ˇquick brown\nfox jumps over\nthe lazy dog"}}
|
||||
{"Key":"ctrl-v"}
|
||||
{"Key":"j"}
|
||||
{"Key":"y"}
|
||||
{"ReadRegister":{"name":"\"","value":"q\nj"}}
|
||||
{"Key":"l"}
|
||||
{"Key":"ctrl-v"}
|
||||
{"Key":"2"}
|
||||
{"Key":"j"}
|
||||
{"Key":"shift-p"}
|
||||
{"Get":{"state":"The qˇqick brown\nfox jjmps over\nthe lzy dog","mode":"Normal"}}
|
||||
{"Key":"shift-v"}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"ˇq\nj\nfox jjmps over\nthe lzy dog","mode":"Normal"}}
|
26
crates/vim/test_data/test_visual_paste.json
Normal file
26
crates/vim/test_data/test_visual_paste.json
Normal file
|
@ -0,0 +1,26 @@
|
|||
{"Put":{"state":"The quick brown\nfox jˇumps over\nthe lazy dog"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"i"}
|
||||
{"Key":"w"}
|
||||
{"Key":"y"}
|
||||
{"Get":{"state":"The quick brown\nfox ˇjumps over\nthe lazy dog","mode":"Normal"}}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"The quick brown\nfox jjumpˇsumps over\nthe lazy dog","mode":"Normal"}}
|
||||
{"Put":{"state":"The quick brown\nfox juˇmps over\nthe lazy dog"}}
|
||||
{"Key":"shift-v"}
|
||||
{"Key":"d"}
|
||||
{"Get":{"state":"The quick brown\nthe laˇzy dog","mode":"Normal"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"i"}
|
||||
{"Key":"w"}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"The quick brown\nthe \nˇfox jumps over\n dog","mode":"Normal"}}
|
||||
{"ReadRegister":{"name":"\"","value":"lazy"}}
|
||||
{"Put":{"state":"The quick brown\nfox juˇmps over\nthe lazy dog"}}
|
||||
{"Key":"shift-v"}
|
||||
{"Key":"d"}
|
||||
{"Get":{"state":"The quick brown\nthe laˇzy dog","mode":"Normal"}}
|
||||
{"Key":"k"}
|
||||
{"Key":"shift-v"}
|
||||
{"Key":"p"}
|
||||
{"Get":{"state":"ˇfox jumps over\nthe lazy dog","mode":"Normal"}}
|
Loading…
Add table
Add a link
Reference in a new issue