Commit 501cb86
fix: use visual column for navigation comparison
The navigation functions compare columns using lines.get_start_col() which
returns visual column (with tab expansion). The current() function in
targets.lua was returning byte column from nodes.get_scol(), causing
sibling detection to fail when files use tabs for indentation.
This fix changes current() to use visual column for the comparison,
using the node's starting row (not cursor row) to handle cases where
cursor is inside a multi-line node that starts on a different line.
Fixes sibling navigation (Up/Down) in files with tab indentation.1 parent 85e79f6 commit 501cb86
1 file changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
8 | 18 | | |
9 | 19 | | |
10 | 20 | | |
| |||
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
48 | | - | |
| 58 | + | |
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
| |||
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
60 | | - | |
| 70 | + | |
61 | 71 | | |
62 | 72 | | |
63 | 73 | | |
| |||
0 commit comments