diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 19 | ||||
-rw-r--r-- | src/Editor.h | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 59bc76e9d..e049485f2 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2063,7 +2063,12 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou continue; } if (p > 0) { - if (ll->styles[p] != ll->styles[p - 1]) { + if (wrapState == eWrapChar){ + lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1) + - posLineStart; + p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart; + continue; + } else if (ll->styles[p] != ll->styles[p - 1]) { lastGoodBreak = p; } else if (IsSpaceOrTab(ll->chars[p - 1]) && !IsSpaceOrTab(ll->chars[p])) { lastGoodBreak = p; @@ -6231,7 +6236,17 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return pdoc->ExtendWordSelect(wParam, 1, lParam != 0); case SCI_SETWRAPMODE: - wrapState = (wParam == SC_WRAP_WORD) ? eWrapWord : eWrapNone; + switch(wParam){ + case SC_WRAP_WORD: + wrapState = eWrapWord; + break; + case SC_WRAP_CHAR: + wrapState = eWrapChar; + break; + default: + wrapState = eWrapNone; + break; + } xOffset = 0; InvalidateStyleRedraw(); ReconfigureScrollBars(); diff --git a/src/Editor.h b/src/Editor.h index e14cb5ed9..bace500bd 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -301,7 +301,7 @@ protected: // ScintillaBase subclass needs access to much of Editor int hsEnd; // Wrapping support - enum { eWrapNone, eWrapWord } wrapState; + enum { eWrapNone, eWrapWord, eWrapChar } wrapState; bool backgroundWrapEnabled; int wrapWidth; int docLineLastWrapped; |