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 176f113a019e..ed94c053cdc6 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) { + if (project != null && editor.getCaretModel().getCaretCount() == 1 && !editor.getSelectionModel().hasSelection()) { HighlightManagerImpl highlightManager = (HighlightManagerImpl)HighlightManager.getInstance(project); if (highlightManager != null && highlightManager.hideHighlights(editor, HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_ANY_KEY)) {