From 6035a9d94ca39b30389fdc3a90b152a568a2c574 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Wed, 18 Oct 2017 11:16:25 +0300 Subject: [PATCH] IDEA-179908 Esc should cancel multiple carets first Bring back old behaviour when highlighting a selection in file (Esc will clear highlights first, then selection). Fixes InjectedLanguageEditingTest.testHighlightSelectionInWholeEditor --- .../com/intellij/codeInsight/highlighting/EscapeHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/EscapeHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/EscapeHandler.java index ed94c053cdc6..305d333c7a17 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/EscapeHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/EscapeHandler.java @@ -28,7 +28,7 @@ public class EscapeHandler extends EditorActionHandler { editor.setHeaderComponent(null); Project project = CommonDataKeys.PROJECT.getData(dataContext); - if (project != null && editor.getCaretModel().getCaretCount() == 1 && !editor.getSelectionModel().hasSelection()) { + if (project != null && editor.getCaretModel().getCaretCount() == 1) { HighlightManagerImpl highlightManager = (HighlightManagerImpl)HighlightManager.getInstance(project); if (highlightManager != null && highlightManager.hideHighlights(editor, HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_ANY_KEY)) {