From 840bc7cdb2c6494aaca1010e39ceec076ea7a827 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 15 Jul 2004 13:56:16 +0000 Subject: 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. --- src/Editor.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') 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(); } -- cgit v1.2.3