mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-07 22:32:08 -08: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
|
||||
(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
|
||||
buffer that shouldn't be in a popup. We prevent that by remapping `quit-window'
|
||||
to this commmand."
|
||||
(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)
|
||||
;; 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
|
||||
;; command in popups:
|
||||
(define-key +popup-buffer-mode-map [remap quit-window] #'+popup/close)
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue