ui/popup: ensure existing buffers are reused
This resolves an issue where the popup manager would open another popup if a previous one had been raised. The popup manager now delegates to the existing buffer if it already exists (without resizing it).
This commit is contained in:
parent
c549091ce5
commit
a22c035815
1 changed files with 17 additions and 10 deletions
|
@ -172,6 +172,13 @@ and enables `+popup-buffer-mode'."
|
|||
(alist (+popup--normalize-alist alist))
|
||||
(actions (or (cdr (assq 'actions alist))
|
||||
+popup-default-display-buffer-actions)))
|
||||
(or (let* ((alist (remove (assq 'window-width alist) alist))
|
||||
(alist (remove (assq 'window-height alist) alist))
|
||||
(window (display-buffer-reuse-window buffer alist)))
|
||||
(when window
|
||||
(unless +popup--inhibit-select
|
||||
(select-window window))
|
||||
window))
|
||||
(when-let* ((popup (cl-loop for func in actions
|
||||
if (funcall func buffer alist)
|
||||
return it)))
|
||||
|
@ -181,7 +188,7 @@ and enables `+popup-buffer-mode'."
|
|||
(if (functionp select)
|
||||
(funcall select popup origin)
|
||||
(select-window (if select popup origin)))))
|
||||
popup)))
|
||||
popup))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup-parameter (parameter &optional window)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue