Fix RIDER-95155

(cherry picked from commit 189c475338c96181464467844e0353b6f818a97f)

NET-MR-12114

GitOrigin-RevId: 5e84b2932f323225cda89a17a26fc78d1eb11582
This commit is contained in:
Kirill Glazyrin
2023-10-04 19:42:54 +00:00
committed by intellij-monorepo-bot
parent cf4c6c35d7
commit 20f3fb9d3e
@@ -161,7 +161,7 @@ public class LexerEditorHighlighter implements EditorHighlighter, PrioritizedDoc
*/
int incrementalUpdate(int eventOffset, int eventOldLength, int eventNewLength, @NotNull Document document) {
CharSequence text = document.getImmutableCharSequence();
if (mySegments.getSegmentCount() == 0) {
if (mySegments.getSegmentCount() == 0 || mySegments.getLastValidOffset() < eventOffset) {
setText(text);
return text.length();
}