switcher - dispose session on quick actions
authorKirill Kalishev <kirill.kalishev@jetbrains.com>
Tue, 27 Apr 2010 09:54:43 +0000 (13:54 +0400)
committerKirill Kalishev <kirill.kalishev@jetbrains.com>
Tue, 27 Apr 2010 09:54:43 +0000 (13:54 +0400)
platform/platform-api/src/com/intellij/ui/switcher/ApplySwitchAction.java
platform/platform-api/src/com/intellij/ui/switcher/SwitchManager.java

index b76995b61ea44834614be224c7962226c9ee793c..a2d42ab9e4c19df8baae53549530912d71f8803d 100644 (file)
@@ -52,6 +52,7 @@ public class ApplySwitchAction extends AnAction {
     if (switchManager.canApplySwitch()) {
       switchManager.applySwitch();
     } else {
+      switchManager.resetSession();
       QuickActionManager.getInstance(project).showQuickActions();
     }
     
index f327baa94bdbd1b5368fc799d2ce19e1ffe60f0f..92ff218cee46befeda9058e618d17d3b2ae94cbb 100644 (file)
@@ -273,4 +273,8 @@ public class SwitchManager implements ProjectComponent, KeyEventDispatcher, Keym
   public boolean canApplySwitch() {
     return isSessionActive() && mySession.isSelectionWasMoved();
   }
+
+  public void resetSession() {
+    disposeSession(mySession);
+  }
 }