From 0ebe7936bc6c72f1157c1b8faf617c36e8cbcb98 Mon Sep 17 00:00:00 2001 From: Sergey Tselovalnikov Date: Fri, 17 Jul 2015 15:18:25 +0300 Subject: [PATCH 1/2] Fix IDE history when exception thrown --- .../impl/IdeDocumentHistoryImpl.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java index d1cebca1ca70..ad9fa350e42c 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java @@ -334,15 +334,17 @@ public class IdeDocumentHistoryImpl extends IdeDocumentHistory implements Projec putLastOrMerge(myForwardPlaces, info, Integer.MAX_VALUE); myBackInProgress = true; - - executeCommand(new Runnable() { - @Override - public void run() { - gotoPlaceInfo(info); - } - }, "", null); - - myBackInProgress = false; + try { + executeCommand(new Runnable() { + @Override + public void run() { + gotoPlaceInfo(info); + } + }, "", null); + } + finally { + myBackInProgress = false; + } } @Override From 060f2ac4c6c93e92cff266a60d67b972d09ab464 Mon Sep 17 00:00:00 2001 From: Sergey Tselovalnikov Date: Fri, 17 Jul 2015 15:23:07 +0300 Subject: [PATCH 2/2] Fix IDE history when exception thrown (forward) --- .../fileEditor/impl/IdeDocumentHistoryImpl.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java index ad9fa350e42c..ca7dd78e1602 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java @@ -355,13 +355,16 @@ public class IdeDocumentHistoryImpl extends IdeDocumentHistory implements Projec if (target == null) return; myForwardInProgress = true; - executeCommand(new Runnable() { - @Override - public void run() { - gotoPlaceInfo(target); - } - }, "", null); - myForwardInProgress = false; + try { + executeCommand(new Runnable() { + @Override + public void run() { + gotoPlaceInfo(target); + } + }, "", null); + } finally { + myForwardInProgress = false; + } } private PlaceInfo getTargetForwardInfo() {