ui/popup: respect :select nil when reusing a window

- before this change: when reusing a window, select option would get ignored
- after this change: when reusing a window, select option would be used
  just as a new popup
This commit is contained in:
Yiming Chen 2019-12-04 08:20:17 +08:00
parent 1655524836
commit ca63b0bbfc

View file

@ -189,7 +189,10 @@ and enables `+popup-buffer-mode'."
(window (display-buffer-reuse-window buffer alist))) (window (display-buffer-reuse-window buffer alist)))
(when window (when window
(unless +popup--inhibit-select (unless +popup--inhibit-select
(select-window window)) (let ((select (+popup-parameter 'select window)))
(if (functionp select)
(funcall select window origin)
(select-window (if select window origin)))))
window)) window))
(when-let (popup (cl-loop for func in actions (when-let (popup (cl-loop for func in actions
if (funcall func buffer alist) if (funcall func buffer alist)