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 88248b888a58..c2ac17aa4b11 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 @@ -166,7 +166,9 @@ public class IdeDocumentHistoryImpl extends IdeDocumentHistory implements Dispos public void extensionRemoved(@NotNull FileEditorProvider provider, @NotNull PluginDescriptor pluginDescriptor) { String editorTypeId = provider.getEditorTypeId(); Predicate clearStatePredicate = e -> editorTypeId.equals(e.getEditorTypeId()); - myChangePlaces.removeIf(clearStatePredicate); + if (myChangePlaces.removeIf(clearStatePredicate)) { + myCurrentIndex = myChangePlaces.size(); + } myBackPlaces.removeIf(clearStatePredicate); myForwardPlaces.removeIf(clearStatePredicate); }