]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug when splitting a frame's root window (Bug#73627)
authorMartin Rudalics <rudalics@gmx.at>
Sun, 13 Oct 2024 07:48:05 +0000 (09:48 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 14 Oct 2024 17:39:59 +0000 (19:39 +0200)
* lisp/window.el (split-window): Split main window of WINDOW's
frame when that frame has side windows (Bug#73627).

(cherry picked from commit a58dc58fec8dc146cf10454c6a2b3174d1b4c2f8)

lisp/window.el

index 712a9ccae045121dedff7b205c38a8bfb68b848a..fed94bb8e6cda66a579d4910fc64b1e8e2e87197 100644 (file)
@@ -5547,6 +5547,13 @@ frame.  The selected window is not changed by this function."
             (setq atom-root (window-atom-root window))
             (not (eq atom-root window)))
        (throw 'done (split-window atom-root size side pixelwise)))
+       ;; If WINDOW's frame has a side window and WINDOW specifies the
+       ;; frame's root window, split the frame's main window instead
+       ;; (Bug#73627).
+       ((and (eq window (frame-root-window frame))
+            (window-with-parameter 'window-side nil frame))
+       (throw 'done (split-window (window-main-window frame)
+                                  size side pixelwise)))
        ;; If WINDOW is a side window or its first or last child is a
        ;; side window, throw an error unless `window-combination-resize'
        ;; equals 'side.