aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2004-07-15 13:56:16 +0000
committernyamatongwe <devnull@localhost>2004-07-15 13:56:16 +0000
commit1006d133f04d8eb8e653c84faa8161bb2909e78b (patch)
tree127018883c39e90c4c44e5a21829f2021b71e30e /src
parent30f2aa33128700150f57246c3fa7d8d7a56c1fdd (diff)
downloadscintilla-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.cxx12
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();
}