]> git.eshelyaron.com Git - emacs.git/commitdiff
xref-goto-xref: Highlight the exact symbol after the jump
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 24 Dec 2018 03:11:02 +0000 (05:11 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 24 Dec 2018 03:11:02 +0000 (05:11 +0200)
* lisp/progmodes/xref.el (xref-goto-xref): Bind
'xref--current-item' to highlight the exact symbol after the jump
and not the whole line.

lisp/progmodes/xref.el

index a0a704f133d3a4c8eb2da449132f9b36a80fc109..c71802c91881648f30df677183d1eb5628de9ca4 100644 (file)
@@ -551,9 +551,10 @@ SELECT is `quit', also quit the *xref* window."
 Non-interactively, non-nil QUIT means to first quit the *xref*
 buffer."
   (interactive)
-  (let ((buffer (current-buffer))
-        (xref (or (xref--item-at-point)
-                  (user-error "No reference at point"))))
+  (let* ((buffer (current-buffer))
+         (xref (or (xref--item-at-point)
+                   (user-error "No reference at point")))
+         (xref--current-item xref))
     (xref--show-location (xref-item-location xref) (if quit 'quit t))
     (next-error-found buffer (current-buffer))))