From: Mattias EngdegÄrd Date: Mon, 16 Dec 2019 21:42:16 +0000 (+0100) Subject: Adjust cursor column when auto-scrolling during rectangle selection X-Git-Tag: emacs-27.0.90~337 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4b2c2faab83fe3b13430b837be7d450b5cd47caf;p=emacs.git Adjust cursor column when auto-scrolling during rectangle selection * 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. --- diff --git a/lisp/mouse.el b/lisp/mouse.el index 32996b2eded..e9156ffe356 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -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)