mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
core-popups: clone buffer if visible elsewhere
Allows us to modify the buffer in the pop up window indepdently from the rest.
This commit is contained in:
@ -114,7 +114,8 @@ only close popups that have an :autoclose property in their rule (see
|
||||
;;;###autoload
|
||||
(defun doom/popup ()
|
||||
"Display currently selected buffer in a popup window."
|
||||
(doom-popup-buffer (current-buffer) :align t))
|
||||
(interactive)
|
||||
(doom-popup-buffer (current-buffer) :align t :autokill t))
|
||||
|
||||
(defun doom--popup-data (window)
|
||||
(let ((buffer (window-buffer window)))
|
||||
|
@ -192,7 +192,11 @@ and setting `doom-popup-rules' within it. Returns the window."
|
||||
(shackle-match (window-buffer (car args))))
|
||||
((bufferp (car args))
|
||||
(shackle-match (car args))))))
|
||||
(window (apply orig-fn args)))
|
||||
window)
|
||||
(when (get-buffer-window-list (car args) nil t)
|
||||
(setq plist (append (list :autokill t) plist))
|
||||
(setcar args (clone-indirect-buffer (buffer-name (car args)) nil t)))
|
||||
(setq window (apply orig-fn args))
|
||||
(unless window
|
||||
(error "No popup window was found for %s: %s" (car args) plist))
|
||||
(with-selected-window window
|
||||
|
@ -74,8 +74,7 @@
|
||||
|
||||
(defun +doom|buffer-mode-off ()
|
||||
"Disable `doom-buffer-mode' in popup buffers."
|
||||
(when (and doom-buffer-mode
|
||||
(not (get-buffer-window-list)))
|
||||
(when doom-buffer-mode
|
||||
(doom-buffer-mode -1)))
|
||||
(add-hook 'doom-popup-mode-hook #'+doom|buffer-mode-off)
|
||||
|
||||
|
Reference in New Issue
Block a user