diff options
author | nyamatongwe <devnull@localhost> | 2009-08-06 09:07:33 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2009-08-06 09:07:33 +0000 |
commit | f18a4f2c6ea768721b6f520a282f0235892d50e5 (patch) | |
tree | 272b247d07dd605d363eec0e7dc2a5a9b5758049 /src | |
parent | bdbda8a953b14e9a99478f1c52dfc10337ee68d3 (diff) | |
download | scintilla-mirror-f18a4f2c6ea768721b6f520a282f0235892d50e5.tar.gz |
Fix bug where indentation guide is drawn over text when the indentation is
in a different style to the default style so spaces are different widths.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 26341fefb..2bbba5aeb 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2840,6 +2840,8 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis if ((vsDraw.viewIndentationGuides == ivLookForward || vsDraw.viewIndentationGuides == ivLookBoth) && (subLine == 0)) { int indentSpace = pdoc->GetLineIndentation(line); + int xStartText = ll->positions[pdoc->GetLineIndentPosition(line) - posLineStart]; + // Find the most recent line with some text int lineLastWithText = line; @@ -2847,6 +2849,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis lineLastWithText--; } if (lineLastWithText < line) { + xStartText = 100000; // Don't limit to visible indentation on empty line // This line is empty, so use indentation of last line with text int indentLastWithText = pdoc->GetLineIndentation(lineLastWithText); int isFoldHeader = pdoc->GetLevel(lineLastWithText) & SC_FOLDLEVELHEADERFLAG; @@ -2876,8 +2879,10 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis for (int indentPos = pdoc->IndentSize(); indentPos < indentSpace; indentPos += pdoc->IndentSize()) { int xIndent = indentPos * vsDraw.spaceWidth; - DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment, - (ll->xHighlightGuide == xIndent)); + if (xIndent < xStartText) { + DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment, + (ll->xHighlightGuide == xIndent)); + } } } |