Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

vim: Fix e/E with inlay hints (#11616)

Conrad Irwin8b5a0cff10a4
diff --git a/crates/editor/src/display_map.rs b/crates/editor/src/display_map.rs
index efae6a030d1..5f989bed581 100644
--- a/crates/editor/src/display_map.rs
+++ b/crates/editor/src/display_map.rs
@@ -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) {
diff --git a/crates/vim/src/motion.rs b/crates/vim/src/motion.rs
index 2c50f52f5a3..3ae99e9ba4a 100644
--- a/crates/vim/src/motion.rs
+++ b/crates/vim/src/motion.rs
@@ -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(