fix(popup): only remap quit-window in popup buffers
This commit is contained in:
parent
08f8f57e2f
commit
3c4921cc57
1 changed files with 4 additions and 5 deletions
|
@ -38,18 +38,17 @@ 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 ()
|
(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. We prevent that by remapping `quit-window'
|
buffer that shouldn't be in a popup. We prevent that by remapping `quit-window'
|
||||||
to this commmand."
|
to this commmand."
|
||||||
(interactive)
|
(interactive "P")
|
||||||
(let ((orig-buffer (current-buffer)))
|
(let ((orig-buffer (current-buffer)))
|
||||||
(quit-window)
|
(quit-window arg)
|
||||||
(when (and (eq orig-buffer (current-buffer))
|
(when (and (eq orig-buffer (current-buffer))
|
||||||
(+popup-buffer-p))
|
(+popup-buffer-p))
|
||||||
(+popup/close nil 'force))))
|
(+popup/close nil 'force))))
|
||||||
(global-set-key [remap quit-window] #'+popup/quit-window)
|
(define-key +popup-buffer-mode-map [remap quit-window] #'+popup/quit-window)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue