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.
This commit is contained in:
Denis Zhdanov
2011-06-23 15:32:14 +04:00
parent d04b0b14c1
commit fc20df1eed
2 changed files with 4 additions and 1 deletions
@@ -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);
@@ -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);
}