From e1ed0c3af182b313f8f1a8f0d50fcda369aaf71c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Thu, 19 Aug 2021 23:15:29 +0200 Subject: [PATCH] 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. --- lisp/progmodes/xref.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index d3780d571fc..b6ad4854070 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -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")))))) -- 2.39.5