From 5f2df49a3d5f38c822b9065a3cb898c992a25abf Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Wed, 26 Feb 2020 17:36:20 +0530 Subject: [PATCH] vcs: Close editor diff preview for "Local Changes" and "Shelf" on pressing "escape" (IDEA-215408) GitOrigin-RevId: 9615806deaa617e88acc352a6c0bd4607e73b148 --- .../com/intellij/openapi/vcs/changes/ChangesViewManager.java | 2 ++ .../openapi/vcs/changes/shelf/ShelvedChangesViewManager.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java index c8f951900fb0..9ebc4ec1a298 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java @@ -481,6 +481,8 @@ public class ChangesViewManager implements ChangesViewEx, } }; editorPreview.setEscapeHandler(() -> { + editorPreview.closePreview(); + ToolWindow toolWindow = getToolWindowFor(myProject, LOCAL_CHANGES); if (toolWindow != null) toolWindow.activate(null); }); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java index 4c93bc3791b9..ba9f1f6a4c00 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java @@ -752,6 +752,8 @@ public class ShelvedChangesViewManager implements Disposable { } }; editorPreview.setEscapeHandler(() -> { + editorPreview.closePreview(); + ToolWindow toolWindow = getToolWindowFor(myProject, SHELF); if (toolWindow != null) toolWindow.activate(null); });