Commit 06c00bc
authored
fix: properly handle ranges ending with a newline (#828)
Fixes #827 . The changes are similar to the ones in #812 , but they are
different from the function mentioned in a comment of that PR
(#812 (comment))
because said function assumes that the range returned is end-inclusive,
while this plugin currently is treating the range as end_exclusive.
This bug was surfaced by #687 (because and `end_row, end_col` pair like
`4, 0` becomes `4, -1` after the change), but this wasn't working
properly before #687 either. The behavior before that PR was to also
select the first character of the next line (so, one character after the
newline).1 parent 7024f86 commit 06c00bc
2 files changed
+18
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
32 | | - | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
0 commit comments