Selection point movement on scroll should move selanchor as well as
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 18 Sep 2001 18:59:37 +0000 (18:59 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 18 Sep 2001 18:59:37 +0000 (18:59 +0000)
selstart and selend, otherwise all those worthy ideals go *foom*
while the mouse buttons are held down.

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

terminal.c

index ab97e3c..f238f09 100644 (file)
@@ -668,6 +668,10 @@ static void scroll(int topline, int botline, int lines, int sb)
             * of course, if the line _hasn't_ moved into the
             * scrollback then we don't do this, and cut them off
             * at the top of the scroll region.
+            * 
+            * This applies to selstart and selend (for an existing
+            * selection), and also selanchor (for one being
+            * selected as we speak).
             */
            seltop = sb ? -savelines : 0;
 
@@ -685,6 +689,13 @@ static void scroll(int topline, int botline, int lines, int sb)
                    selend.x = 0;
                }
            }
+           if (selanchor.y >= seltop && selanchor.y <= botline) {
+               selanchor.y--;
+               if (selanchor.y < seltop) {
+                   selanchor.y = seltop;
+                   selanchor.x = 0;
+               }
+           }
 
            lines--;
        }