Skip to content

Commit

Permalink
vim: Fix e/E with inlay hints
Browse files Browse the repository at this point in the history
Co-Authored-By: Sergey <sergey.b@hey.com>
Fixes: #7046
  • Loading branch information
ConradIrwin and Vagab committed May 9, 2024
1 parent ddaaaee commit 7fd2ac2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions crates/editor/src/display_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,10 @@ impl DisplaySnapshot {
DisplayPoint(clipped)
}

pub fn clip_ignoring_line_ends(&self, point: DisplayPoint, bias: Bias) -> DisplayPoint {
DisplayPoint(self.block_snapshot.clip_point(point.0, bias))
}

pub fn clip_at_line_end(&self, point: DisplayPoint) -> DisplayPoint {
let mut point = point.0;
if point.column == self.line_len(point.row) {
Expand Down
4 changes: 2 additions & 2 deletions crates/vim/src/motion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ pub(crate) fn next_char(
*new_point.row_mut() += 1;
*new_point.column_mut() = 0;
}
new_point
map.clip_ignoring_line_ends(new_point, Bias::Right)
}

pub(crate) fn next_word_start(
Expand Down Expand Up @@ -1155,7 +1155,7 @@ pub(crate) fn next_word_end(
},
);
let new_point = if need_next_char {
next_char(map, new_point, true)
next_char(map, point, allow_cross_newline)
} else {
new_point
};
Expand Down

0 comments on commit 7fd2ac2

Please sign in to comment.