diff options
author | nyamatongwe <devnull@localhost> | 2012-04-03 23:11:58 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2012-04-03 23:11:58 +1000 |
commit | cb8e7cc28672a39c2bf78e2caf1dac74e745d5ee (patch) | |
tree | b2027e61ec62c9063330a7ea1f4665b5a3fc802a | |
parent | 0e69118174f80ad06cd05edd4aa6aaf12c22f9ee (diff) | |
download | scintilla-mirror-cb8e7cc28672a39c2bf78e2caf1dac74e745d5ee.tar.gz |
Moved wrap indent code to wrapping branch.
-rw-r--r-- | src/Editor.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index b287384d4..7adff4037 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2308,17 +2308,6 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou width = 20; } if ((ll->validity == LineLayout::llPositions) || (ll->widthLine != width)) { - XYPOSITION wrapAddIndent = 0; // This will be added to initial indent of line - if (wrapIndentMode == SC_WRAPINDENT_INDENT) { - wrapAddIndent = pdoc->IndentSize() * vstyle.spaceWidth; - } else if (wrapIndentMode == SC_WRAPINDENT_SAME) { - wrapAddIndent = 0; - } else { //SC_WRAPINDENT_FIXED - wrapAddIndent = wrapVisualStartIndent * vstyle.aveCharWidth; - if ((wrapVisualFlags & SC_WRAPVISUALFLAG_START) && (wrapAddIndent <= 0)) - wrapAddIndent = vstyle.aveCharWidth; // must indent to show start visual - } - ll->widthLine = width; if (width == LineLayout::wrapWidthInfinite) { ll->lines = 1; @@ -2329,6 +2318,12 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou if (wrapVisualFlags & SC_WRAPVISUALFLAG_END) { width -= static_cast<int>(vstyle.aveCharWidth); // take into account the space for end wrap mark } + XYPOSITION wrapAddIndent = 0; // This will be added to initial indent of line + if (wrapIndentMode == SC_WRAPINDENT_INDENT) { + wrapAddIndent = pdoc->IndentSize() * vstyle.spaceWidth; + } else if (wrapIndentMode == SC_WRAPINDENT_FIXED) { + wrapAddIndent = wrapVisualStartIndent * vstyle.aveCharWidth; + } ll->wrapIndent = wrapAddIndent; if (wrapIndentMode != SC_WRAPINDENT_FIXED) for (int i = 0; i < ll->numCharsInLine; i++) { |