Function: consult-xref--preview
consult-xref--preview is a byte-compiled function defined in
consult-xref.el.
Signature
(consult-xref--preview DISPLAY)
Documentation
Xref preview with DISPLAY function.
Source Code
;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult-xref.el
(defun consult-xref--preview (display)
"Xref preview with DISPLAY function."
(let ((open (consult--temporary-files))
(preview (consult--jump-preview)))
(lambda (action cand)
(unless cand
(funcall open))
(let ((consult--buffer-display display))
(funcall preview action
(when-let* ((loc (and cand (eq action 'preview)
(xref-item-location cand)))
(type (type-of loc))
;; Only preview xrefs listed in consult-xref--preview
((memq type consult-xref--preview)))
(pcase type
((or 'xref-file-location 'xref-etags-location)
(consult--marker-from-line-column
(funcall open
;; xref-location-group returns the file name
(let ((xref-file-name-display 'abs))
(xref-location-group loc)))
(xref-location-line loc)
(if (eq type 'xref-file-location)
(xref-file-location-column loc)
0)))
(_ (xref-location-marker loc)))))))))