diff options
author | Neil <nyamatongwe@gmail.com> | 2014-02-02 18:09:44 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-02-02 18:09:44 +1100 |
commit | 687cd7a0e91208e97bd198cf13f416b0937dd6c3 (patch) | |
tree | a6d7f5846f990f253133af659524622292192736 /src | |
parent | e9b3faa25f71650ed4c16aeeef893dd72d713525 (diff) | |
download | scintilla-mirror-687cd7a0e91208e97bd198cf13f416b0937dd6c3.tar.gz |
Added wrap mode SC_WRAP_WHITESPACE which only wraps on whitespace, not on style changes.
From Robert Gieseke.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 2 | ||||
-rw-r--r-- | src/ViewStyle.cxx | 3 | ||||
-rw-r--r-- | src/ViewStyle.h | 2 |
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: |