From e8f3e8616bc8a69f9f479bc596519e129fe0c511 Mon Sep 17 00:00:00 2001 From: Peter Gromov Date: Mon, 3 Aug 2020 12:09:26 +0200 Subject: [PATCH] a shorter fix for console being cleared when inserting small text after a very large text (IDEA-CR-65713) GitOrigin-RevId: f31c0e75b6c6c04632cb1e3919746b5818677374 --- .../src/com/intellij/execution/impl/TokenBuffer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/execution-impl/src/com/intellij/execution/impl/TokenBuffer.java b/platform/execution-impl/src/com/intellij/execution/impl/TokenBuffer.java index d1b9f1ada500..7f93ca2cdc38 100644 --- a/platform/execution-impl/src/com/intellij/execution/impl/TokenBuffer.java +++ b/platform/execution-impl/src/com/intellij/execution/impl/TokenBuffer.java @@ -104,10 +104,10 @@ final class TokenBuffer { // toss tokens from the beginning until size became < maxCapacity while (size - startIndex > maxCapacity) { TokenInfo info = tokens.getFirst(); - int length = info.length() - startIndex; - if (length > size - maxCapacity - startIndex) { + int length = info.length(); + if (length > size - maxCapacity) { // slice a part of this info - startIndex += size - maxCapacity - startIndex; + startIndex = size - maxCapacity; break; } startIndex = 0;