diff --git a/source/com/intellij/codeInsight/highlighting/HighlightManagerImpl.java b/source/com/intellij/codeInsight/highlighting/HighlightManagerImpl.java index d12d71dce740..9220bf59c261 100644 --- a/source/com/intellij/codeInsight/highlighting/HighlightManagerImpl.java +++ b/source/com/intellij/codeInsight/highlighting/HighlightManagerImpl.java @@ -153,10 +153,7 @@ public class HighlightManagerImpl extends HighlightManager implements ProjectCom if (hideByTextChange) { flags |= HighlightManagerImpl.HIDE_BY_TEXT_CHANGE; } - Color scrollmarkColor = null; - if (attributes.getBackgroundColor() != null) { - scrollmarkColor = attributes.getBackgroundColor().darker(); - } + Color scrollmarkColor = getScrollMarkColor(attributes); for (int i = 0; i < occurrences.length; i++) { PsiReference occurrence = occurrences[i]; @@ -177,10 +174,7 @@ public class HighlightManagerImpl extends HighlightManager implements ProjectCom if (hideByTextChange) { flags |= HighlightManagerImpl.HIDE_BY_TEXT_CHANGE; } - Color scrollmarkColor = null; - if (attributes.getBackgroundColor() != null) { - scrollmarkColor = attributes.getBackgroundColor().darker(); - } + Color scrollmarkColor = getScrollMarkColor(attributes); for (int i = 0; i < elements.length; i++) { final PsiElement element = elements[i]; @@ -213,10 +207,8 @@ public class HighlightManagerImpl extends HighlightManager implements ProjectCom if (hideByTextChange) { flags |= HighlightManagerImpl.HIDE_BY_TEXT_CHANGE; } - Color scrollmarkColor = null; - if (attributes.getBackgroundColor() != null) { - scrollmarkColor = attributes.getBackgroundColor().darker(); - } + + Color scrollmarkColor = getScrollMarkColor(attributes); addOccurrenceHighlight(editor, startOffset, endOffset, attributes, flags, highlighters, scrollmarkColor); } @@ -229,10 +221,8 @@ public class HighlightManagerImpl extends HighlightManager implements ProjectCom if (hideByTextChange) { flags |= HighlightManagerImpl.HIDE_BY_TEXT_CHANGE; } - Color scrollmarkColor = null; - if (attributes.getBackgroundColor() != null) { - scrollmarkColor = attributes.getBackgroundColor().darker(); - } + + Color scrollmarkColor = getScrollMarkColor(attributes); for (int i = 0; i < elements.length; i++) { PsiElement element = elements[i]; @@ -243,6 +233,12 @@ public class HighlightManagerImpl extends HighlightManager implements ProjectCom } } + private Color getScrollMarkColor(final TextAttributes attributes) { + if (attributes.getErrorStripeColor() != null) return attributes.getErrorStripeColor(); + if (attributes.getBackgroundColor() != null) return attributes.getBackgroundColor().darker(); + return null; + } + public boolean hideHighlights(Editor editor, int mask) { ArrayList highlightersToRemove = new ArrayList();