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

Conrad Irwin and Sergey created

Co-Authored-By: Sergey <sergey.b@hey.com>
Fixes: #7046

Release Notes:

- vim: Fixes e/E with inlay hints (#7046)

Co-authored-by: Sergey <sergey.b@hey.com>

Change summary

crates/editor/src/display_map.rs | 4 ++++
crates/vim/src/motion.rs         | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)

Detailed changes

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) {

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(