Support "dtx" vim key combination when "x" is immediately to the right of the cursor (#6830)
Closes #4358
The bug originates on this line:
5db7e8f89e/crates/vim/src/motion.rs (L451)
- When running "dtx" on "ˇabcx", the range to delete is 0 -> 2 ("abc")
- When running "dtx" on "abˇcx", the range to delete is 2 -> 2 ("c"), so
`new_point == point` and the function incorrectly returns `None` and "c"
is not deleted
- We need to disambiguate between the "not found" case and the "found
immediately to the right" case
- This bug does not apply to the backwards case ("dTx")
Release Notes:
- Fixed "dtx" vim key combination when "x" is immediately to the right
of the cursor (#4358)
This commit is contained in:
commit
331b6e7e6e
3 changed files with 28 additions and 8 deletions
10
crates/vim/test_data/test_delete_to_adjacent_character.json
Normal file
10
crates/vim/test_data/test_delete_to_adjacent_character.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{"Put":{"state":"ˇax"}}
|
||||
{"Key":"d"}
|
||||
{"Key":"t"}
|
||||
{"Key":"x"}
|
||||
{"Get":{"state":"ˇx","mode":"Normal"}}
|
||||
{"Put":{"state":"aˇx"}}
|
||||
{"Key":"d"}
|
||||
{"Key":"t"}
|
||||
{"Key":"x"}
|
||||
{"Get":{"state":"aˇx","mode":"Normal"}}
|
Loading…
Add table
Add a link
Reference in a new issue