Fix silly scrolling-vs-selection bug: if you selected text on line
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 28 Oct 2001 09:38:43 +0000 (09:38 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 28 Oct 2001 09:38:43 +0000 (09:38 +0000)
9, then did ANSI Delete Line on line 10, the selection highlight
would move up a line even though it wasn't over any text that
actually moved. Easy to reproduce in the likes of vi. Trivial fix.

git-svn-id: svn://svn.tartarus.org/sgt/putty@1334 cda61777-01e9-0310-a592-d414129be87e

terminal.c

index 5cd4c17..412f6b4 100644 (file)
@@ -676,7 +676,7 @@ static void scroll(int topline, int botline, int lines, int sb)
             * selection), and also selanchor (for one being
             * selected as we speak).
             */
-           seltop = sb ? -savelines : 0;
+           seltop = sb ? -savelines : topline;
 
            if (selstart.y >= seltop && selstart.y <= botline) {
                selstart.y--;