Commit 64fc1ee
committed
fix(cli): implement sticky column for multiline cursor navigation
Fixes cursor position resetting when navigating up/down through lines of
varying lengths. The cursor now remembers its target column during
vertical navigation, matching standard text editor behavior.
- Add stickyColumnRef to track goal column during up/down navigation
- Add getOrSetStickyColumn helper that captures column on first vertical
movement and reuses it for subsequent movements
- Add desiredIndex parameter to calculateNewCursorPosition
- Clear sticky column on any non-vertical key press1 parent 483aa39 commit 64fc1ee
File tree
2 files changed
+49
-11
lines changed- cli/src
- components
- utils
2 files changed
+49
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
142 | 165 | | |
143 | 166 | | |
144 | 167 | | |
| |||
324 | 347 | | |
325 | 348 | | |
326 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
327 | 355 | | |
328 | 356 | | |
329 | 357 | | |
| |||
699 | 727 | | |
700 | 728 | | |
701 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
702 | 734 | | |
703 | 735 | | |
704 | 736 | | |
705 | 737 | | |
706 | | - | |
| 738 | + | |
707 | 739 | | |
708 | 740 | | |
| 741 | + | |
709 | 742 | | |
710 | 743 | | |
711 | 744 | | |
| |||
714 | 747 | | |
715 | 748 | | |
716 | 749 | | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
717 | 753 | | |
718 | 754 | | |
719 | 755 | | |
720 | 756 | | |
721 | | - | |
| 757 | + | |
722 | 758 | | |
723 | 759 | | |
| 760 | + | |
724 | 761 | | |
725 | 762 | | |
726 | 763 | | |
| |||
| 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 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
19 | | - | |
| 22 | + | |
20 | 23 | | |
21 | | - | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
0 commit comments