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
This commit is contained in:
Dmitry Batrak
2017-10-18 11:16:25 +03:00
parent bca4208e47
commit 6035a9d94c
@@ -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)) {