Commit 6214abb
committed
Overhaul LastVisualX and GetVisualX() usage
Restore the original meaning of LastVisualX before commit 6d13710
("Implement moving cursor up/down within a wrapped line"): last visual x
location of the cursor in a logical line in the buffer, not in a visual
line on the screen (in other words, taking tabs and wide characters into
account, but not taking softwrap into account). And add a separate
LastWrappedVisualX field, similar to LastVisualX but taking softwrap
into account as well.
This allows tracking last x position at the same time for both cases
when we care about softwrap and when we don't care about it. This can be
useful, for example, for implementing cursor up/down movement actions
that always move by logical lines, not by visual lines, even if softwrap
is enabled (in addition to our default CursorUp and CursorDown actions
that move by visual lines).
Also this fixes a minor bug: in InsertTab(), when `tabstospaces` is
enabled and we insert a tab, the amount of inserted spaces depends on
the visual line wrapping (i.e. on the window width), which is probably
not a good idea.1 parent 85afb6e commit 6214abb
File tree
4 files changed
+28
-16
lines changed- internal
- action
- buffer
- display
- runtime/plugins/status
4 files changed
+28
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | | - | |
| 192 | + | |
194 | 193 | | |
195 | 194 | | |
196 | | - | |
| 195 | + | |
197 | 196 | | |
198 | 197 | | |
199 | 198 | | |
| |||
889 | 888 | | |
890 | 889 | | |
891 | 890 | | |
892 | | - | |
| 891 | + | |
893 | 892 | | |
894 | 893 | | |
895 | 894 | | |
| |||
1275 | 1274 | | |
1276 | 1275 | | |
1277 | 1276 | | |
| 1277 | + | |
1278 | 1278 | | |
1279 | 1279 | | |
1280 | 1280 | | |
| |||
1291 | 1291 | | |
1292 | 1292 | | |
1293 | 1293 | | |
| 1294 | + | |
1294 | 1295 | | |
1295 | 1296 | | |
1296 | 1297 | | |
| |||
1360 | 1361 | | |
1361 | 1362 | | |
1362 | 1363 | | |
| 1364 | + | |
1363 | 1365 | | |
1364 | 1366 | | |
1365 | 1367 | | |
| |||
1380 | 1382 | | |
1381 | 1383 | | |
1382 | 1384 | | |
| 1385 | + | |
1383 | 1386 | | |
1384 | 1387 | | |
1385 | 1388 | | |
| |||
2070 | 2073 | | |
2071 | 2074 | | |
2072 | 2075 | | |
| 2076 | + | |
2073 | 2077 | | |
2074 | 2078 | | |
2075 | 2079 | | |
| |||
2082 | 2086 | | |
2083 | 2087 | | |
2084 | 2088 | | |
2085 | | - | |
| 2089 | + | |
2086 | 2090 | | |
2087 | 2091 | | |
| 2092 | + | |
2088 | 2093 | | |
2089 | 2094 | | |
2090 | 2095 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | | - | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
76 | | - | |
77 | | - | |
| 82 | + | |
| 83 | + | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| |||
615 | 621 | | |
616 | 622 | | |
617 | 623 | | |
618 | | - | |
| 624 | + | |
| 625 | + | |
619 | 626 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments