diff options
| author | Mattias EngdegÄrd | 2019-12-16 22:42:16 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-12-17 10:04:05 +0100 |
| commit | 4b2c2faab83fe3b13430b837be7d450b5cd47caf (patch) | |
| tree | d2dba939ab265b812c5ba121b0705c939dfab33e | |
| parent | 1a2445c45f901d9d939f2992dd8e616e5d7cb9ca (diff) | |
| download | emacs-4b2c2faab83fe3b13430b837be7d450b5cd47caf.tar.gz 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.
| -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." | |||
| 2037 | (funcall adjusted-col mouse-col) 'point) | 2037 | (funcall adjusted-col mouse-col) 'point) |
| 2038 | (unless mouse--rectangle-track-cursor | 2038 | (unless mouse--rectangle-track-cursor |
| 2039 | (forward-char)) | 2039 | (forward-char)) |
| 2040 | (rectangle--reset-point-crutches))))) | 2040 | (rectangle--reset-point-crutches)))) |
| 2041 | (scroll-adjust (lambda () | ||
| 2042 | (move-to-column | ||
| 2043 | (funcall adjusted-col mouse-col)) | ||
| 2044 | (funcall set-col)))) | ||
| 2041 | (if (and (eq window start-window) | 2045 | (if (and (eq window start-window) |
| 2042 | mouse-row | 2046 | mouse-row |
| 2043 | (<= top mouse-row (1- bottom))) | 2047 | (<= top mouse-row (1- bottom))) |
| @@ -2051,11 +2055,11 @@ This must be bound to a button-down mouse event." | |||
| 2051 | ((< mouse-row top) | 2055 | ((< mouse-row top) |
| 2052 | (mouse-scroll-subr | 2056 | (mouse-scroll-subr |
| 2053 | start-window (- mouse-row top) nil start-point | 2057 | start-window (- mouse-row top) nil start-point |
| 2054 | set-col)) | 2058 | scroll-adjust)) |
| 2055 | ((>= mouse-row bottom) | 2059 | ((>= mouse-row bottom) |
| 2056 | (mouse-scroll-subr | 2060 | (mouse-scroll-subr |
| 2057 | start-window (1+ (- mouse-row bottom)) nil start-point | 2061 | start-window (1+ (- mouse-row bottom)) nil start-point |
| 2058 | set-col))))))) | 2062 | scroll-adjust))))))) |
| 2059 | (condition-case err | 2063 | (condition-case err |
| 2060 | (progn | 2064 | (progn |
| 2061 | (setq track-mouse t) | 2065 | (setq track-mouse t) |