diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2019-12-16 22:42:16 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2019-12-17 10:04:05 +0100 |
commit | 4b2c2faab83fe3b13430b837be7d450b5cd47caf (patch) | |
tree | d2dba939ab265b812c5ba121b0705c939dfab33e /lisp/mouse.el | |
parent | 1a2445c45f901d9d939f2992dd8e616e5d7cb9ca (diff) | |
download | emacs-4b2c2faab83fe3b13430b837be7d450b5cd47caf.tar.gz emacs-4b2c2faab83fe3b13430b837be7d450b5cd47caf.tar.bz2 emacs-4b2c2faab83fe3b13430b837be7d450b5cd47caf.zip |
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.
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r-- | lisp/mouse.el | 10 |
1 files changed, 7 insertions, 3 deletions
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) |