aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 9ae4fb59a..b287384d4 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -213,7 +213,6 @@ Editor::Editor() {
wrapVisualFlagsLocation = 0;
wrapVisualStartIndent = 0;
wrapIndentMode = SC_WRAPINDENT_FIXED;
- wrapAddIndent = 0;
convertPastes = true;
@@ -297,15 +296,6 @@ void Editor::RefreshStyleData() {
if (surface) {
vs.Refresh(*surface);
}
- if (wrapIndentMode == SC_WRAPINDENT_INDENT) {
- wrapAddIndent = pdoc->IndentSize() * vs.spaceWidth;
- } else if (wrapIndentMode == SC_WRAPINDENT_SAME) {
- wrapAddIndent = 0;
- } else { //SC_WRAPINDENT_FIXED
- wrapAddIndent = wrapVisualStartIndent * vs.aveCharWidth;
- if ((wrapVisualFlags & SC_WRAPVISUALFLAG_START) && (wrapAddIndent <= 0))
- wrapAddIndent = vs.aveCharWidth; // must indent to show start visual
- }
SetScrollBars();
SetRectangularRange();
}
@@ -2318,6 +2308,17 @@ 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;