vim: Fix cgn backwards movement when there is no matches (#10237)
Release Notes: - Fixed `cgn` backwards movement problem in #9982 There are two issues: - When there are no more matches, the next repetition still moves the cursor to the left. After that, the recording is cleared. For this I simply move the cursor to the right, but it doesn't work when the cursor is at the end of the line. - If `cgn` is used when there are no matches, it cleans the previous recorded actions. Maybe there should be a way to revert the recording. This also happens when using `c` and `esc` --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
0390df27d4
commit
f9bf60f017
5 changed files with 79 additions and 3 deletions
28
crates/vim/test_data/test_cgn_nomatch.json
Normal file
28
crates/vim/test_data/test_cgn_nomatch.json
Normal file
|
@ -0,0 +1,28 @@
|
|||
{"Put":{"state":"aaˇ aa aa aa aa"}}
|
||||
{"Key":"/"}
|
||||
{"Key":"b"}
|
||||
{"Key":"b"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"aaˇ aa aa aa aa","mode":"Normal"}}
|
||||
{"Key":"c"}
|
||||
{"Key":"g"}
|
||||
{"Key":"n"}
|
||||
{"Key":"x"}
|
||||
{"Key":"escape"}
|
||||
{"Get":{"state":"aaˇaa aa aa aa","mode":"Normal"}}
|
||||
{"Key":"."}
|
||||
{"Get":{"state":"aaˇa aa aa aa","mode":"Normal"}}
|
||||
{"Put":{"state":"aaˇ bb aa aa aa"}}
|
||||
{"Key":"/"}
|
||||
{"Key":"b"}
|
||||
{"Key":"b"}
|
||||
{"Key":"enter"}
|
||||
{"Get":{"state":"aa ˇbb aa aa aa","mode":"Normal"}}
|
||||
{"Key":"c"}
|
||||
{"Key":"g"}
|
||||
{"Key":"n"}
|
||||
{"Key":"x"}
|
||||
{"Key":"escape"}
|
||||
{"Get":{"state":"aa ˇx aa aa aa","mode":"Normal"}}
|
||||
{"Key":"."}
|
||||
{"Get":{"state":"aa ˇx aa aa aa","mode":"Normal"}}
|
Loading…
Add table
Add a link
Reference in a new issue