branch: externals/consult
commit b50118f6e9ddf296c48e052d8b8d6dc6fa419e6f
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Simplify consult--buffer-preview again
---
consult.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/consult.el b/consult.el
index e95d53c991..54ddc9bd30 100644
--- a/consult.el
+++ b/consult.el
@@ -4142,12 +4142,13 @@ Report progress and return a list of the results"
(lambda (action cand)
;; Only preview in current window and other window.
;; Preview in frames and tabs is not possible since these don't get
cleaned up.
- (when (or (eq consult--buffer-display #'switch-to-buffer)
+ (when (or (eq action 'preview)
+ (eq consult--buffer-display #'switch-to-buffer)
(eq consult--buffer-display #'switch-to-buffer-other-window))
(cond
- ((and cand (eq action 'preview) (get-buffer cand))
+ ((and cand (get-buffer cand))
(consult--buffer-action cand 'norecord))
- ((and (memq action '(preview exit)) (buffer-live-p orig-buf))
+ ((buffer-live-p orig-buf)
(consult--buffer-action orig-buf 'norecord)))))))
(defun consult--buffer-action (buffer &optional norecord)