mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
core-popups: fix popup window cleanup (and fix #27)
+ No longer deletes window parameters before attempting to read them. + Don't disable doom-popup-mode if the buffer's getting killed anyway. + Fix indentation issues.
This commit is contained in:
@ -169,18 +169,17 @@ prevent popups from messaging up the UI (or vice versa)."
|
||||
(defun doom*delete-popup-window (orig-fn &rest args)
|
||||
"Ensure that popups are deleted properly, and killed if they have :autokill
|
||||
properties."
|
||||
(let ((window (car args)))
|
||||
(let ((window (or (car args) (selected-window))))
|
||||
(when (doom-popup-p window)
|
||||
(with-selected-window window
|
||||
(doom-popup-mode -1)
|
||||
(unless doom-popup-mode
|
||||
(mapc (lambda (cfg) (set-window-parameter window cfg nil))
|
||||
'(popup no-other-window noesc autokill)))
|
||||
(set-window-dedicated-p window nil)
|
||||
(when doom-popup-remember-history
|
||||
(setq doom-popup-history (list (doom--popup-data window))))
|
||||
(when (window-parameter window 'autokill)
|
||||
(kill-buffer (window-buffer window))))))
|
||||
(when doom-popup-remember-history
|
||||
(setq doom-popup-history (list (doom--popup-data window))))
|
||||
(set-window-dedicated-p window nil)
|
||||
(if (window-parameter window 'autokill)
|
||||
(kill-buffer (window-buffer window))
|
||||
(with-selected-window window
|
||||
(doom-popup-mode -1)))
|
||||
(mapc (lambda (cfg) (set-window-parameter window cfg nil))
|
||||
'(popup no-other-window noesc autokill))))
|
||||
(apply orig-fn args))
|
||||
|
||||
(advice-add 'shackle-display-buffer :around 'doom*popup-init)
|
||||
|
Reference in New Issue
Block a user