From 5f6535e92bccc248267dc2f227f6d87280b695ae Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 2 Aug 2023 15:06:46 +0100 Subject: [PATCH] TEMP --- crates/editor/src/element.rs | 1 + crates/vim/src/visual.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 98bf41cdae..bc6c2f0bb8 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -865,6 +865,7 @@ impl EditorElement { layout.position_map.snapshot.line_len(cursor_row) as usize; } } + dbg!(selection.head, cursor_row, cursor_column); if layout.visible_display_row_range.contains(&cursor_row) { let cursor_row_layout = &layout.position_map.line_layouts diff --git a/crates/vim/src/visual.rs b/crates/vim/src/visual.rs index 8338d32de4..1716e2d1a5 100644 --- a/crates/vim/src/visual.rs +++ b/crates/vim/src/visual.rs @@ -67,7 +67,9 @@ pub fn visual_motion(motion: Motion, times: Option, cx: &mut WindowContex // ensure the current character is included in the selection. if !selection.reversed { + // TODO: maybe try clipping left for multi-buffers let next_point = movement::right(map, selection.end); + if !(next_point.column() == 0 && next_point == map.max_point()) { selection.end = movement::right(map, selection.end) }