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)

This commit is contained in:
Anton Makeev
2016-12-12 16:17:11 +01:00
parent 1e6699f9ad
commit 97765ed6a5
5 changed files with 10 additions and 7 deletions
@@ -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;
@@ -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
@@ -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);
@@ -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);
}
@@ -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();