From c78e91e07d4e306b91868a9bdee6d7e8e1e5349a Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Thu, 30 Jun 2016 19:04:30 +0300 Subject: [PATCH] lst: refresh only after the last of enclosed WriteActions We don't use afterWriteActionFinished because we want to update inside same WriteLock section. --- .../intellij/openapi/vcs/ex/LineStatusTracker.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java index 94045c141fa9..dc6947ae5461 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java @@ -398,9 +398,19 @@ public class LineStatusTracker { } private class MyApplicationListener extends ApplicationAdapter { + private int myWriteActionDepth = 0; + + @Override + public void writeActionStarted(@NotNull Object action) { + myWriteActionDepth++; + } + @Override public void writeActionFinished(@NotNull Object action) { - updateRanges(); + myWriteActionDepth = Math.max(myWriteActionDepth - 1, 0); + if (myWriteActionDepth == 0) { + updateRanges(); + } } }