]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix dragging dividers in terminal Emacs when there's margins
authorJared Finder <jared@finder.org>
Tue, 15 Jun 2021 13:54:08 +0000 (15:54 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 15 Jun 2021 13:54:08 +0000 (15:54 +0200)
* 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

index f4979e37b0e4dfe63fc379c219bf89f41f503bc2..d0064eecfc7f6b56ee954fc27531bd02b4c1f30e 100644 (file)
@@ -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)))))))