summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2020-11-07 09:20:14 +0100
committerMartin Rudalics <rudalics@gmx.at>2020-11-07 09:20:14 +0100
commitf4acd7a924fbb6400130e5091ea37e50e2d0fac2 (patch)
tree6deb2b8cd866d99c47281b99ea76d00ad2734f1c /lisp
parent0cdd6c9218f7df5793155e86d2028288b9b38bd1 (diff)
downloademacs-f4acd7a924fbb6400130e5091ea37e50e2d0fac2.tar.gz
Split windows evenly when 'min-margins' parameter was set (Bug#44483)
* lisp/window.el (split-window): Make new window inherit any 'min-margins' parameter from WINDOW so that horizontal splits reliably produce windows of same width (Bug#44483).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/window.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 48005fc93e0..ba56dedf046 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5412,7 +5412,13 @@ frame. The selected window is not changed by this function."
(set-window-parameter (window-parent new) 'window-atom t))
(set-window-parameter new 'window-atom t)))
- ;; Sanitize sizes unless SIZE was specified.
+ ;; Make the new window inherit the `min-margins' parameter of
+ ;; WINDOW (Bug#44483).
+ (let ((min-margins (window-parameter window 'min-margins)))
+ (when min-margins
+ (set-window-parameter new 'min-margins min-margins)))
+
+ ;; Sanitize sizes unless SIZE was specified.
(unless size
(window--sanitize-window-sizes horizontal))