]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix xref {prev,next}-error target buffer match highlighting extent
authorMattias Engdegård <mattiase@acm.org>
Thu, 19 Aug 2021 21:15:29 +0000 (23:15 +0200)
committerMattias Engdegård <mattiase@acm.org>
Fri, 20 Aug 2021 10:34:34 +0000 (12:34 +0200)
* 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

index d3780d571fc0e77fdfa436398cc9fb056959e53f..b6ad4854070ec7e7a2d03e896484a3f6c26b400e 100644 (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"))))))