New feature: <Alt+Shift+click1> on tab does "Close Others" pycharm/162.242
authorVassiliy.Kudryashov <Vassiliy.Kudryashov@jetbrains.com>
Tue, 17 May 2016 05:51:19 +0000 (08:51 +0300)
committerVassiliy.Kudryashov <Vassiliy.Kudryashov@jetbrains.com>
Tue, 17 May 2016 06:02:11 +0000 (09:02 +0300)
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorTabbedContainer.java

index b4aab6f86ea1d080a1368c469af70ad2e6a99ad6..e9f9dc4e2f4f3a70affb9e0a34814bb6deb007fe 100644 (file)
@@ -539,7 +539,15 @@ public final class EditorTabbedContainer implements Disposable, CloseAction.Clos
         final TabInfo info = myTabs.findInfo(e);
         if (info != null) {
           IdeEventQueue.getInstance().blockNextEvents(e);
-          FileEditorManagerEx.getInstanceEx(myProject).closeFile((VirtualFile)info.getObject(), myWindow);
+          if (e.isAltDown()) {//close others
+            List<TabInfo> allTabInfos = myTabs.getTabs();
+            for (TabInfo tabInfo : allTabInfos) {
+              if (tabInfo == info) continue;
+              FileEditorManagerEx.getInstanceEx(myProject).closeFile((VirtualFile)tabInfo.getObject(), myWindow);
+            }
+          } else {
+            FileEditorManagerEx.getInstanceEx(myProject).closeFile((VirtualFile)info.getObject(), myWindow);
+          }
         }
       }
     }