lst: release LST when last editor is closed
authorAleksey Pivovarov <aleksey.pivovarov@jetbrains.com>
Mon, 2 May 2016 18:23:25 +0000 (21:23 +0300)
committerAleksey Pivovarov <aleksey.pivovarov@jetbrains.com>
Mon, 2 May 2016 18:26:34 +0000 (21:26 +0300)
it was broken in 85108ac - `getEditors` now returns currently releasing editor, if called from `EditorFactoryListener.editorReleased`

platform/vcs-impl/src/com/intellij/openapi/vcs/impl/LineStatusTrackerManager.java

index 4becda0c5dba0d90291bef9628a05d3bd7675458..73c577d03c438153847714e47cde3dc277892d54 100644 (file)
@@ -447,7 +447,7 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
       if (editor.getProject() != null && editor.getProject() != myProject) return;
       final Document doc = editor.getDocument();
       final Editor[] editors = event.getFactory().getEditors(doc, myProject);
-      if (editors.length == 0) {
+      if (editors.length == 0 || (editors.length == 1 && editor == editors[0])) {
         releaseTracker(doc);
       }
     }