Commit c7e4bc97 authored by Felicián Németh's avatar Felicián Németh Committed by Eli Zaretskii
Browse files

Jump to the current error in xref with zero prefix arg

* xref.el (xref--next-error-function): Handle the corner case of
n == 0.  (Bug#34462)
parent 476066e8
Pipeline #840 passed with stage
in 51 minutes and 35 seconds
......@@ -694,8 +694,10 @@ references displayed in the current *xref* buffer."
(let ((backward (< n 0))
(n (abs n))
(xref nil))
(dotimes (_ n)
(setq xref (xref--search-property 'xref-item backward)))
(if (= n 0)
(setq xref (get-text-property (point) 'xref-item))
(dotimes (_ n)
(setq xref (xref--search-property 'xref-item backward))))
(cond (xref
;; Save the current position (when the buffer is visible,
;; it gets reset to that window's point from time to time).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment