From 97765ed6a53360edb1e349dfc010fd7aa6245da1 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Mon, 12 Dec 2016 16:14:55 +0100 Subject: [PATCH] Allow custom highlighting layer in the console filter: use HYPERLINK layer consistently + better CONSOLE_FILTER naming (ref CPP-7974 CMake Output: Make CMake errors more visible) --- .../intellij/openapi/editor/markup/HighlighterLayer.java | 7 +++++-- .../src/com/intellij/execution/filters/Filter.java | 2 +- .../intellij/codeInsight/navigation/CtrlMouseHandler.java | 2 +- .../intellij/execution/impl/EditorHyperlinkSupport.java | 2 +- .../impl/evaluate/quick/common/AbstractValueHint.java | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/HighlighterLayer.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/HighlighterLayer.java index 0ef57e995e0f..bba3b485d9e7 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/HighlighterLayer.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/HighlighterLayer.java @@ -24,8 +24,11 @@ public interface HighlighterLayer { int ERROR = 5000; int ELEMENT_UNDER_CARET = 5500; - /** the default layer for console filters highlighters */ - int HIGHLIGHT_LAYER = 5800; + /** + * The default layer for console filters highlighters + * Ref: com.intellij.execution.filters.Filter + * */ + int CONSOLE_FILTER = 5800; int HYPERLINK = 5900; int SELECTION = 6000; diff --git a/platform/lang-api/src/com/intellij/execution/filters/Filter.java b/platform/lang-api/src/com/intellij/execution/filters/Filter.java index 7dac4b6ea9ea..f404c3f7b522 100644 --- a/platform/lang-api/src/com/intellij/execution/filters/Filter.java +++ b/platform/lang-api/src/com/intellij/execution/filters/Filter.java @@ -251,7 +251,7 @@ public interface Filter { } public int getHighlighterLayer() { - return getHyperlinkInfo() != null ? HighlighterLayer.HYPERLINK : HighlighterLayer.HIGHLIGHT_LAYER; + return getHyperlinkInfo() != null ? HighlighterLayer.HYPERLINK : HighlighterLayer.CONSOLE_FILTER; } @Nullable diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/CtrlMouseHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/CtrlMouseHandler.java index 386d471d61ad..af744d8abc20 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/CtrlMouseHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/CtrlMouseHandler.java @@ -959,7 +959,7 @@ public class CtrlMouseHandler extends AbstractProjectComponent { for (TextRange range : info.getRanges()) { TextAttributes attr = NavigationUtil.patchAttributesColor(attributes, range, editor); final RangeHighlighter highlighter = editor.getMarkupModel().addRangeHighlighter(range.getStartOffset(), range.getEndOffset(), - HighlighterLayer.SELECTION + 1, + HighlighterLayer.HYPERLINK, attr, HighlighterTargetArea.EXACT_RANGE); highlighters.add(highlighter); diff --git a/platform/platform-impl/src/com/intellij/execution/impl/EditorHyperlinkSupport.java b/platform/platform-impl/src/com/intellij/execution/impl/EditorHyperlinkSupport.java index 16a7bf8fb9f1..eb6f5c03052e 100644 --- a/platform/platform-impl/src/com/intellij/execution/impl/EditorHyperlinkSupport.java +++ b/platform/platform-impl/src/com/intellij/execution/impl/EditorHyperlinkSupport.java @@ -292,7 +292,7 @@ public class EditorHyperlinkSupport { } public void addHighlighter(int highlightStartOffset, int highlightEndOffset, TextAttributes highlightAttributes) { - addHighlighter(highlightStartOffset, highlightEndOffset, highlightAttributes, HighlighterLayer.HIGHLIGHT_LAYER); + addHighlighter(highlightStartOffset, highlightEndOffset, highlightAttributes, HighlighterLayer.CONSOLE_FILTER); } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/AbstractValueHint.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/AbstractValueHint.java index 088bc0ce12c6..a5d1ec34df7a 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/AbstractValueHint.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/AbstractValueHint.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,7 +157,7 @@ public abstract class AbstractValueHint { attributes = NavigationUtil.patchAttributesColor(attributes, myCurrentRange, myEditor); myHighlighter = myEditor.getMarkupModel().addRangeHighlighter(myCurrentRange.getStartOffset(), myCurrentRange.getEndOffset(), - HighlighterLayer.SELECTION + 1, attributes, + HighlighterLayer.HYPERLINK, attributes, HighlighterTargetArea.EXACT_RANGE); Component internalComponent = myEditor.getContentComponent(); myStoredCursor = internalComponent.getCursor();