diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentGuideRenderer.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentGuideRenderer.java index 4c61bd744e7f..0af125821adf 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentGuideRenderer.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentGuideRenderer.java @@ -18,6 +18,7 @@ import com.intellij.util.ObjectUtils; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.text.CharArrayUtil; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.awt.*; import java.util.List; @@ -85,11 +86,11 @@ public class IndentGuideRenderer implements CustomHighlighterRenderer { } boolean selected = isSelected(editor, endOffset, startOffset, lineStartPosition.column); - if (!selected && editor instanceof EditorImpl editorImpl && editorImpl.isStickyLinePainting()) { - // suppress indent vertical lines on sticky lines panel + boolean stickyPainting = editor instanceof EditorImpl editorImpl && editorImpl.isStickyLinePainting(); + Color color = getIndentColor(editor, startOffset, selected, stickyPainting); + if (color == null) { return; } - Color color = getIndentColor(editor, startOffset, selected); int lineHeight = editor.getLineHeight(); Point start = editor.visualPositionToXY(lineStartPosition); @@ -162,7 +163,7 @@ public class IndentGuideRenderer implements CustomHighlighterRenderer { } - private static Color getIndentColor(Editor editor, int startOffset, boolean selected) { + private static @Nullable Color getIndentColor(Editor editor, int startOffset, boolean selected, boolean stickyPainting) { EditorColorsScheme scheme = editor.getColorsScheme(); if (ExperimentalUI.isNewUI()) { List highlighters = ContainerUtil.filter(editor.getMarkupModel().getAllHighlighters(), @@ -179,6 +180,10 @@ public class IndentGuideRenderer implements CustomHighlighterRenderer { } } } + if (!selected && stickyPainting) { + // suppress indent vertical lines on sticky lines panel + return null; + } return scheme.getColor(selected ? EditorColors.SELECTED_INDENT_GUIDE_COLOR : EditorColors.INDENT_GUIDE_COLOR); } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 37672f453071..92dc5ed1ad2a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -5662,7 +5662,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi } /** - * If true, the editor is in special "clean" mode when editor's content is rendering on sticky lines panel. + * If true, the editor is in special "clean" mode when editor's content is being rendered on sticky lines panel. * This allows suppressing visual elements like caret row background, vertical indent lines, right margin line, etc. */ @ApiStatus.Internal