]> git.eshelyaron.com Git - emacs.git/commitdiff
Adjust cursor column when auto-scrolling during rectangle selection
authorMattias Engdegård <mattiase@acm.org>
Mon, 16 Dec 2019 21:42:16 +0000 (22:42 +0100)
committerMattias Engdegård <mattiase@acm.org>
Tue, 17 Dec 2019 09:04:05 +0000 (10:04 +0100)
* lisp/mouse.el (mouse-drag-region-rectangle):
Move cursor to the correct column during auto-scrolling both when
crutches are used and not (bug#38641).  Reported by Konrad Podczeck.

lisp/mouse.el

index 32996b2eded590be51a1db274ed60e65ab666373..e9156ffe3566e2df3c4e87dd0ffb066ff3a57428 100644 (file)
@@ -2037,7 +2037,11 @@ This must be bound to a button-down mouse event."
                                (funcall adjusted-col mouse-col) 'point)
                             (unless mouse--rectangle-track-cursor
                               (forward-char))
-                            (rectangle--reset-point-crutches)))))
+                            (rectangle--reset-point-crutches))))
+               (scroll-adjust (lambda ()
+                                (move-to-column
+                                 (funcall adjusted-col mouse-col))
+                                (funcall set-col))))
           (if (and (eq window start-window)
                    mouse-row
                    (<= top mouse-row (1- bottom)))
@@ -2051,11 +2055,11 @@ This must be bound to a button-down mouse event."
              ((< mouse-row top)
               (mouse-scroll-subr
                start-window (- mouse-row top) nil start-point
-               set-col))
+               scroll-adjust))
              ((>= mouse-row bottom)
               (mouse-scroll-subr
                start-window (1+ (- mouse-row bottom)) nil start-point
-               set-col)))))))
+               scroll-adjust)))))))
     (condition-case err
         (progn
           (setq track-mouse t)