zed/crates/vim/src
Hans eaec04632a
vim: Fix t operand not working correctly when cursor is on tag (#9899)
Fix #8994 and #9844 

Release notes:
* Fixed the `t` object in Vim mode not working correctly when cursor was
on a tag. #9844 and #8994

This mr fixes the above two problems, for #9844, because our previous
logic is to only think that the minimum html tag containing the current
cursor is qualified, but the approach of nvim is to get the tag after
the current cursor first, followed by the tag around the current cursor,
so I modified the corresponding condition

For #8994, the situation is a bit more complicated, in our previous
implementation, we could only get the range of the object by a `cursor
position`, but there are two possible cases for the html tag:
When the current cursor length is 1, nvim will return the first tag
after the current cursor, as described above
When the current cursor length is greater than 1, nvim will return just
the smallest tag that can cover the current selection

So we may need to pass the current selection to the inside of the
method, and the point alone is not enough to support us in calculating
these conditions
2024-03-28 10:16:54 +01:00
..
normal vim: Make cc and S auto-indent (#9731) 2024-03-28 07:01:00 +01:00
test
command.rs
editor_events.rs
insert.rs
mode_indicator.rs
motion.rs
normal.rs
object.rs vim: Fix t operand not working correctly when cursor is on tag (#9899) 2024-03-28 10:16:54 +01:00
replace.rs
state.rs
test.rs
utils.rs
vim.rs
visual.rs vim: Fix t operand not working correctly when cursor is on tag (#9899) 2024-03-28 10:16:54 +01:00