mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user