diff options
author | nyamatongwe <devnull@localhost> | 2004-07-15 13:56:16 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2004-07-15 13:56:16 +0000 |
commit | 1006d133f04d8eb8e653c84faa8161bb2909e78b (patch) | |
tree | 127018883c39e90c4c44e5a21829f2021b71e30e /src | |
parent | 30f2aa33128700150f57246c3fa7d8d7a56c1fdd (diff) | |
download | scintilla-mirror-1006d133f04d8eb8e653c84faa8161bb2909e78b.tar.gz |
Patch from Trent Mick to not treat the end of line characters as part
of the line for SCI_LINEENDWRAP and SCI_LINEENDWRAPEXTEND when in wrap
mode with visible end of line.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index fedc91f59..64f3da3a1 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4156,16 +4156,20 @@ int Editor::KeyCommand(unsigned int iMessage) { break; case SCI_LINEENDWRAP: { int endPos = MovePositionSoVisible(StartEndDisplayLine(currentPos, false), 1); - if (currentPos >= endPos) - endPos = pdoc->LineEndPosition(currentPos); + int realEndPos = pdoc->LineEndPosition(currentPos); + if (endPos > realEndPos // if moved past visible EOLs + || currentPos >= endPos) // if at end of display line already + endPos = realEndPos; MovePositionTo(endPos); SetLastXChosen(); } break; case SCI_LINEENDWRAPEXTEND: { int endPos = MovePositionSoVisible(StartEndDisplayLine(currentPos, false), 1); - if (currentPos >= endPos) - endPos = pdoc->LineEndPosition(currentPos); + int realEndPos = pdoc->LineEndPosition(currentPos); + if (endPos > realEndPos // if moved past visible EOLs + || currentPos >= endPos) // if at end of display line already + endPos = realEndPos; MovePositionTo(endPos, selStream); SetLastXChosen(); } |