Fix xref {prev,next}-error target buffer match highlighting extent

* lisp/progmodes/xref.el (xref--next-error-function):
Bind `xref--current-item` during the call to `xref--show-location` so
that `xref-pulse-momentarily` finds the match extent.
This commit is contained in:
Mattias Engdegård 2021-08-19 23:15:29 +02:00
parent c69b4768d6
commit e1ed0c3af1

View file

@ -877,7 +877,8 @@ beginning of the line."
;; it gets reset to that window's point from time to time).
(let ((win (get-buffer-window (current-buffer))))
(and win (set-window-point win (point))))
(xref--show-location (xref-item-location xref) t))
(let ((xref--current-item xref))
(xref--show-location (xref-item-location xref) t)))
(t
(error "No %s xref" (if backward "previous" "next"))))))