emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c621004: Fix dragging dividers in terminal Emacs when there's mar


From: Lars Ingebrigtsen
Subject: master c621004: Fix dragging dividers in terminal Emacs when there's margins
Date: Tue, 15 Jun 2021 09:54:16 -0400 (EDT)

branch: master
commit c62100465e61f0656875716d67c1d7c64248f031
Author: Jared Finder <jared@finder.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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 f4979e3..d0064ee 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)))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]