From: Jared Finder Date: Tue, 15 Jun 2021 13:54:08 +0000 (+0200) Subject: Fix dragging dividers in terminal Emacs when there's margins X-Git-Tag: emacs-28.0.90~2115 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c62100465e61f0656875716d67c1d7c64248f031;p=emacs.git Fix dragging dividers in terminal Emacs when there's margins * lisp/mouse.el (mouse-drag-line): Do the right thing in the presence of margins (bug#41156). (mouse-drag-line): Bind left-margin/right-margin in the map, too. --- diff --git a/lisp/mouse.el b/lisp/mouse.el index f4979e37b0e..d0064eecfc7 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -415,7 +415,7 @@ must be one of the symbols `header', `mode', or `vertical'." (when (window-live-p (setq posn-window (posn-window start))) ;; Add left edge of `posn-window' to `position'. (setq position (+ (window-pixel-left posn-window) position)) - (unless (nth 1 start) + (unless (posn-area start) ;; Add width of objects on the left of the text area to ;; `position'. (when (eq (window-current-scroll-bars posn-window) 'left) @@ -494,9 +494,11 @@ must be one of the symbols `header', `mode', or `vertical'." (define-key map [header-line] map) (define-key map [vertical-line] map) ;; ... and some maybe even with a right- or bottom-divider - ;; prefix. + ;; or left- or right-margin prefix ... (define-key map [right-divider] map) (define-key map [bottom-divider] map) + (define-key map [left-margin] map) + (define-key map [right-margin] map) map) t (lambda () (setq track-mouse old-track-mouse)))))))