mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-10 08:41:32 -07:00
fix(popup): remap quit-window to +popup/close
Ensures popups closed via `quit-window` are remembered (for later restoration, if possible). Fix: #8650 Close: #8653
This commit is contained in:
parent
b468dae066
commit
29bc91bca5
1 changed files with 4 additions and 11 deletions
|
|
@ -38,17 +38,10 @@ grows larger."
|
||||||
;; Don't try to resize popup windows
|
;; Don't try to resize popup windows
|
||||||
(advice-add #'balance-windows :around #'+popup-save-a)
|
(advice-add #'balance-windows :around #'+popup-save-a)
|
||||||
|
|
||||||
(defun +popup/quit-window (&optional arg)
|
;; The regular `quit-window' sometimes kills the popup buffer and switches to a
|
||||||
"The regular `quit-window' sometimes kills the popup buffer and switches to a
|
;; buffer that shouldn't be in a popup; this is prevented by remapping the
|
||||||
buffer that shouldn't be in a popup. We prevent that by remapping `quit-window'
|
;; command in popups:
|
||||||
to this commmand."
|
(define-key +popup-buffer-mode-map [remap quit-window] #'+popup/close)
|
||||||
(interactive "P")
|
|
||||||
(let ((orig-buffer (current-buffer)))
|
|
||||||
(quit-window arg)
|
|
||||||
(when (and (eq orig-buffer (current-buffer))
|
|
||||||
(+popup-buffer-p))
|
|
||||||
(+popup/close nil 'force))))
|
|
||||||
(define-key +popup-buffer-mode-map [remap quit-window] #'+popup/quit-window)
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue