use of com.intellij.codeInsight.daemon.NonHideableIconGutterMark in project intellij-community by JetBrains.
the class EditorGutterComponentImpl method buildGutterRenderersCache.
private void buildGutterRenderersCache() {
myLineToGutterRenderers = new TIntObjectHashMap<>();
processRangeHighlighters(0, myEditor.getDocument().getTextLength(), highlighter -> {
GutterMark renderer = highlighter.getGutterIconRenderer();
if (renderer == null) {
return;
}
if (!areIconsShown() && !(renderer instanceof NonHideableIconGutterMark)) {
return;
}
if (!isHighlighterVisible(highlighter)) {
return;
}
int lineStartOffset = EditorUtil.getNotFoldedLineStartOffset(myEditor, highlighter.getStartOffset());
int line = myEditor.getDocument().getLineNumber(lineStartOffset);
List<GutterMark> renderers = myLineToGutterRenderers.get(line);
if (renderers == null) {
renderers = new SmartList<>();
myLineToGutterRenderers.put(line, renderers);
}
renderers.add(renderer);
});
myLineToGutterRenderers.transformValues(value -> {
List<GutterMark> newValue = value;
for (GutterMarkPreprocessor preprocessor : GutterMarkPreprocessor.EP_NAME.getExtensions()) {
newValue = preprocessor.processMarkers(value);
}
if (newValue.size() >= 5) {
newValue = newValue.subList(0, 4);
}
return newValue;
});
}
Aggregations