Repository navigation
Commit 2ff384a
code-lsp: clamp positions to a line's content, without overflow
Positions.offset clamped a character past a line's end to its \n, so on
a line ending in \r\n, it pointed between the \r and the \n. And it added
the character to the line's start before clamping, so a huge one (as some
clients send, for the end of the line) overflowed to a negative offset.
Now a line ends before its line break, \r\n included, and the character
is clamped before it is added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent c72e2f8 commit 2ff384a
2 files changed
Lines changed: 25 additions & 1 deletion
File tree
- scijava-code-lsp/src
- main/java/org/scijava/code/lsp
- test/java/org/scijava/code/lsp
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
71 | 91 | | |
72 | 92 | | |
73 | 93 | | |
| |||
0 commit comments