From fc20df1eed1b5c2e2cf25b7c7583e15ab1c8c2ed Mon Sep 17 00:00:00 2001 From: Denis Zhdanov Date: Thu, 23 Jun 2011 15:30:39 +0400 Subject: [PATCH] IDEA-71304 Editor: Correct brace highlighting for the active debugger line Don't bound line highlighter to the first non-space offset. Bind it to the line start offset instead. --- .../src/com/intellij/openapi/editor/ex/MarkupModelEx.java | 2 ++ .../src/com/intellij/openapi/editor/impl/MarkupModelImpl.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/ex/MarkupModelEx.java b/platform/platform-impl/src/com/intellij/openapi/editor/ex/MarkupModelEx.java index 7f87859f38c6..80df64baa398 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/ex/MarkupModelEx.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/ex/MarkupModelEx.java @@ -23,6 +23,7 @@ import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.util.Consumer; import com.intellij.util.Processor; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.Iterator; @@ -33,6 +34,7 @@ import java.util.Iterator; public interface MarkupModelEx extends MarkupModel { void dispose(); + @Nullable RangeHighlighter addPersistentLineHighlighter(int lineNumber, int layer, TextAttributes textAttributes); boolean containsHighlighter(@NotNull RangeHighlighter highlighter); diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/MarkupModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/MarkupModelImpl.java index fef5de229164..7a6dcfc033b5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/MarkupModelImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/MarkupModelImpl.java @@ -69,7 +69,8 @@ public class MarkupModelImpl extends UserDataHolderBase implements MarkupModelEx throw new IndexOutOfBoundsException("lineNumber:" + lineNumber + ". Must be in [0, " + (getDocument().getLineCount() - 1) + "]"); } - int offset = getFirstNonspaceCharOffset(getDocument(), lineNumber); + int offset = getDocument().getLineStartOffset(lineNumber); + //int offset = getFirstNonspaceCharOffset(getDocument(), lineNumber); return addRangeHighlighter(offset, offset, layer, textAttributes, HighlighterTargetArea.LINES_IN_RANGE); }