Function: evil-window-delete

evil-window-delete is an interactive and byte-compiled function defined in evil-commands.el.

Signature

(evil-window-delete)

Documentation

Delete the current window or tab.

If evil-auto-balance-windows is non-nil then all children of the deleted window's parent window are rebalanced.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
(evil-define-command evil-window-delete ()
  "Delete the current window or tab.
If `evil-auto-balance-windows' is non-nil then all children of
the deleted window's parent window are rebalanced."
  (let ((p (window-parent)))
    ;; If tabs are enabled and this is the only visible window, then attempt to
    ;; close this tab.
    (if (and (bound-and-true-p tab-bar-mode)
             (null p))
        (tab-close)
      (delete-window)
      (when evil-auto-balance-windows
        ;; balance-windows raises an error if the parent does not have
        ;; any further children (then rebalancing is not necessary anyway)
        (ignore-errors (balance-windows p))))))