From c62100465e61f0656875716d67c1d7c64248f031 Mon Sep 17 00:00:00 2001 From: Jared Finder Date: Tue, 15 Jun 2021 15:54:08 +0200 Subject: [PATCH] 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. --- lisp/mouse.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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))))))) -- 2.39.5