fix some vim mode bugs around deletions and failed motions

This commit is contained in:
Kay Simmons 2022-11-02 01:20:11 -07:00
parent 0cd2d9a9c8
commit 4977acf6a5
17 changed files with 154 additions and 97 deletions

View file

@ -677,6 +677,19 @@ impl<'a> MutableSelectionsCollection<'a> {
});
}
pub fn maybe_move_cursors_with(
&mut self,
mut update_cursor_position: impl FnMut(
&DisplaySnapshot,
DisplayPoint,
SelectionGoal,
) -> Option<(DisplayPoint, SelectionGoal)>,
) {
self.move_cursors_with(|map, point, goal| {
update_cursor_position(map, point, goal).unwrap_or((point, goal))
})
}
pub fn replace_cursors_with(
&mut self,
mut find_replacement_cursors: impl FnMut(&DisplaySnapshot) -> Vec<DisplayPoint>,