From 6ba6b802e75666feed746f9fbb278b558ece34be Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Thu, 16 Feb 2012 15:39:24 +0100 Subject: [PATCH] IDEA-68201 Switcher does not allow switching to a file in another editor group (fix when max tabs == 1) --- .../src/com/intellij/ide/actions/Switcher.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java index 63e5e1df46f0..1431219b2f57 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java @@ -17,7 +17,6 @@ package com.intellij.ide.actions; import com.intellij.featureStatistics.FeatureUsageTracker; import com.intellij.ide.IdeEventQueue; -import com.intellij.ide.ui.UISettings; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.editor.markup.EffectType; @@ -85,7 +84,7 @@ public class Switcher extends AnAction implements DumbAware { public void run() { synchronized (Switcher.class) { if (SWITCHER != null) { - SWITCHER.navigate(); + //SWITCHER.navigate(); } } } @@ -112,8 +111,8 @@ public class Switcher extends AnAction implements DumbAware { if (event.getID() == KEY_RELEASED && keyEvent.getKeyCode() == CTRL_KEY) { SwingUtilities.invokeLater(CHECKER); } else if (event.getID() == KEY_PRESSED && (tw = SWITCHER.twShortcuts.get(String.valueOf((char)keyEvent.getKeyCode()))) != null) { - SWITCHER.myPopup.closeOk(null); - tw.activate(null, true, true); + //SWITCHER.myPopup.closeOk(null); + //tw.activate(null, true, true); } } return false; @@ -149,7 +148,7 @@ public class Switcher extends AnAction implements DumbAware { } private class SwitcherPanel extends JPanel implements KeyListener, MouseListener, MouseMotionListener { - public final int MAX_FILES = UISettings.getInstance().EDITOR_TAB_LIMIT; + private static final int MAX_FILES_IN_SWITCHER = 30; final JBPopup myPopup; final Map ids = new HashMap(); final JList toolWindows; @@ -269,7 +268,7 @@ public class Switcher extends AnAction implements DumbAware { filesData.add(0, editors.get(0)); } } else { - for (int i = 0; i < Math.min(MAX_FILES, editors.size()); i++) { + for (int i = 0; i < Math.min(MAX_FILES_IN_SWITCHER, editors.size()); i++) { filesData.add(editors.get(i)); } }