emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c7e4bc9: Jump to the current error in xref with zer


From: Eli Zaretskii
Subject: [Emacs-diffs] master c7e4bc9: Jump to the current error in xref with zero prefix arg
Date: Sat, 23 Feb 2019 04:37:21 -0500 (EST)

branch: master
commit c7e4bc974b7ec3d6fdae105df05fc19a2cf9fdbd
Author: Felicián Németh <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 lisp/progmodes/xref.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 9522d7e..6974d00 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -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).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]