[terminal] IJPL-203233 Ensure anyLineChanged flag is set before flushing the changes

There are reports with exceptions where for some reason, `linesDiscardedFromHistory` is called without preceding `linesChanged`, so `anyLineChanged` flag is not set. As a result, we get NPE here and crush the terminal session emulation.
Since the actual case is unclear, let's just ensure that this flag is set.

GitOrigin-RevId: dcd27ea51fc1dbc69889fe2d9ff443139ea250dd
This commit is contained in:
Konstantin Hudyakov
2025-08-21 17:47:50 +00:00
committed by intellij-monorepo-bot
parent a027b32550
commit 1513f7024b
@@ -57,6 +57,7 @@ class TerminalContentChangesTracker(
else {
val additionalLines = lines.subList(lastChangedVisualLine, lines.size)
lastChangedVisualLine = 0
anyLineChanged = true
flushChanges(additionalLines)
}
}