aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx2
-rw-r--r--src/ViewStyle.cxx3
-rw-r--r--src/ViewStyle.h2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 6694cbbb3..0f0eed80b 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -2400,7 +2400,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
- posLineStart;
p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart;
continue;
- } else if (ll->styles[p] != ll->styles[p - 1]) {
+ } else if ((vstyle.wrapState == eWrapWord) && (ll->styles[p] != ll->styles[p - 1])) {
lastGoodBreak = p;
} else if (IsSpaceOrTab(ll->chars[p - 1]) && !IsSpaceOrTab(ll->chars[p])) {
lastGoodBreak = p;
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index 4b82c9c05..503775dbf 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -450,6 +450,9 @@ bool ViewStyle::SetWrapState(int wrapState_) {
case SC_WRAP_CHAR:
wrapStateWanted = eWrapChar;
break;
+ case SC_WRAP_WHITESPACE:
+ wrapStateWanted = eWrapWhitespace;
+ break;
default:
wrapStateWanted = eWrapNone;
break;
diff --git a/src/ViewStyle.h b/src/ViewStyle.h
index 3fbe2d751..da8b7e141 100644
--- a/src/ViewStyle.h
+++ b/src/ViewStyle.h
@@ -56,7 +56,7 @@ enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterInden
typedef std::map<FontSpecification, FontRealised *> FontMap;
-enum WrapMode { eWrapNone, eWrapWord, eWrapChar };
+enum WrapMode { eWrapNone, eWrapWord, eWrapChar, eWrapWhitespace };
class ColourOptional : public ColourDesired {
public: