ZIm/crates/vim/src
Adam Mulvany 852439452c
vim: Fix cursor jumping past empty lines with inlay hints in visual mode (#35757)
**Summary**

Fixes #29134 - Visual mode cursor incorrectly jumps past empty lines
that contain inlay hints (type hints).

**Problem**

When in VIM visual mode, pressing j to move down from a longer line to
an empty line that contains an inlay hint would cause the cursor to skip
the empty line entirely and jump to the next line. This only occurred
when moving down (not up) and only in visual mode.

**Root Cause**

The issue was introduced by commit f9ee28db5e which added bias-based
navigation for handling multi-line inlay hints. When using Bias::Right
while moving down, the clipping logic would place the cursor past the
inlay hint, causing it to jump to the next line.

**Solution**
Added logic in up_down_buffer_rows to detect when clipping would place
the cursor within an inlay hint position. When detected, it uses the
buffer column position instead of the display column to avoid jumping
past the hint.

**Testing**

- Added comprehensive test case
test_visual_mode_with_inlay_hints_on_empty_line that reproduces the
exact scenario
- Manually verified the fix with the reproduction case from the issue
- All 356 tests pass with `cargo test -p vim`

**Release Notes:**
- Fixed VIM visual mode cursor jumping past empty lines with type hints
when navigating down
2025-08-21 21:20:22 -06:00
..
digraph Add Vim digraphs (#14887) 2024-07-28 22:44:32 -06:00
normal vim: Implement partial increment/decrement for visual selection (#36553) 2025-08-22 03:02:47 +00:00
test Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
change_list.rs Remove unnecessary argument from Vim#update_editor (#36001) 2025-08-11 16:10:06 -06:00
command.rs Fix clippy::println_empty_string, clippy::while_let_on_iterator, clippy::while_let_on_iterator lint style violations (#36613) 2025-08-20 20:14:30 +02:00
digraph.rs Fix clippy::len_zero lint style violations (#36589) 2025-08-20 14:35:59 +00:00
helix.rs Another batch of lint fixes (#36521) 2025-08-19 20:33:44 +00:00
indent.rs Remove unnecessary argument from Vim#update_editor (#36001) 2025-08-11 16:10:06 -06:00
insert.rs vim: Add ctrl-y/e in insert mode (#36017) 2025-08-11 23:20:09 -06:00
mode_indicator.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
motion.rs vim: Fix cursor jumping past empty lines with inlay hints in visual mode (#35757) 2025-08-21 21:20:22 -06:00
normal.rs Fix iterator related clippy style lint violations (#36437) 2025-08-19 10:06:35 +02:00
object.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
replace.rs Remove unnecessary argument from Vim#update_editor (#36001) 2025-08-11 16:10:06 -06:00
rewrap.rs Remove unnecessary argument from Vim#update_editor (#36001) 2025-08-11 16:10:06 -06:00
state.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
surrounds.rs Auto-fix clippy::collapsible_if violations (#36428) 2025-08-19 13:27:24 +00:00
test.rs lsp: Wait for shutdown response before sending exit notification (#33417) 2025-07-15 18:30:57 +03:00
vim.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
visual.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00