generalize stopping at boundary over operations

This commit is contained in:
Francis Chua 2023-11-12 17:25:42 +00:00
parent 5c7bbe2e59
commit c60ba82699

View file

@ -22,10 +22,8 @@ impl Input {
let step = Self::find_word_boundary(
snap.value[idx..].chars(),
// When in vim mode and deleting, we want to skip over the boundary of words.
// In other words |A|bcd efg when deleting till the end of the word should be
// | |efg as opposed to |d| efg.
if let InputOp::Delete(..) = snap.op { false } else { opt.end_of_word },
// If not in vim mode or just moving (not deleting or yanking), use end_of_word.
if let InputOp::None = snap.op { opt.end_of_word } else { false },
opt.end_of_word,
);
self.move_(step as isize)