fix inclusive offsets in cpp test
This commit is contained in:
@ -76,14 +76,13 @@ final class FragmentedTextDocument extends BaseMappedDocument implements TextDoc
|
||||
lastAccessedFragment = f;
|
||||
}
|
||||
|
||||
if (!inclusive && f.outEnd() == outOffset) {
|
||||
if (f.next != null) {
|
||||
if (inclusive && f.outEnd() == outOffset && f.next != null) {
|
||||
// Inclusive means, the offset must correspond to a character in the source document.
|
||||
// Here we have to skip forward to the fragment that contains the character, because
|
||||
// it's not this one.
|
||||
do {
|
||||
f = f.next;
|
||||
lastAccessedFragment = f;
|
||||
// fallthrough
|
||||
} else {
|
||||
return f.outToIn(outOffset) + 1;
|
||||
}
|
||||
} while (f.next != null && f.outLen() == 0);
|
||||
}
|
||||
return f.outToIn(outOffset);
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
[Image] or [Truncated image[ Bcol Ecol
|
||||
L1
|
||||
[void] 1 2
|
||||
L5
|
||||
[main] 2 2
|
||||
L9
|
||||
[(] 2 2
|
||||
L6
|
||||
[main] 1 2
|
||||
L10
|
||||
[)] 2 2
|
||||
L12
|
||||
[{] 2 2
|
||||
L14
|
||||
[}] 2 2
|
||||
[(] 1 2
|
||||
L11
|
||||
[)] 1 2
|
||||
L13
|
||||
[{] 1 2
|
||||
L15
|
||||
[}] 1 2
|
||||
EOF
|
||||
|
Reference in New Issue
Block a user