vim: Allow search with operators & visual mode (#10226)
Fixes: #4346 Release Notes: - vim: Add search motions (`/,?,n,N,*,#`) in visual modes and as targets for operators like `d`,`c`,`y` ([#4346](https://github.com/zed-industries/zed/issues/4346)).
This commit is contained in:
parent
f9bf60f017
commit
f327118e06
11 changed files with 316 additions and 36 deletions
7
crates/vim/test_data/test_d_search.json
Normal file
7
crates/vim/test_data/test_d_search.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{"Put":{"state":"ˇa.c. abcd a.c. abcd"}}
|
||||
{"Key":"d"}
|
||||
{"Key":"/"}
|
||||
{"Key":"c"}
|
||||
{"Key":"d"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"ˇcd a.c. abcd","mode":"Normal"}}
|
28
crates/vim/test_data/test_v_search.json
Normal file
28
crates/vim/test_data/test_v_search.json
Normal file
|
@ -0,0 +1,28 @@
|
|||
{"Put":{"state":"ˇa.c. abcd a.c. abcd"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"/"}
|
||||
{"Key":"c"}
|
||||
{"Key":"d"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"«a.c. abcˇ»d a.c. abcd","mode":"Visual"}}
|
||||
{"Put":{"state":"a a aˇ a a a"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"/"}
|
||||
{"Key":"a"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"a a a« aˇ» a a","mode":"Visual"}}
|
||||
{"Key":"/"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"a a a« a aˇ» a","mode":"Visual"}}
|
||||
{"Key":"?"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"a a a« aˇ» a a","mode":"Visual"}}
|
||||
{"Key":"?"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"a a «ˇa »a a a","mode":"Visual"}}
|
||||
{"Key":"/"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"a a a« aˇ» a a","mode":"Visual"}}
|
||||
{"Key":"/"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"a a a« a aˇ» a","mode":"Visual"}}
|
7
crates/vim/test_data/test_visual_block_search.json
Normal file
7
crates/vim/test_data/test_visual_block_search.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{"Put":{"state":"ˇone two\nthree four\nfive six\n"}}
|
||||
{"Key":"ctrl-v"}
|
||||
{"Key":"j"}
|
||||
{"Key":"/"}
|
||||
{"Key":"f"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"«one twoˇ»\n«three fˇ»our\nfive six\n","mode":"VisualBlock"}}
|
Loading…
Add table
Add a link
Reference in a new issue