diff options
| author | Felicián Németh | 2019-02-13 21:19:36 +0100 |
|---|---|---|
| committer | Eli Zaretskii | 2019-02-23 11:34:34 +0200 |
| commit | c7e4bc974b7ec3d6fdae105df05fc19a2cf9fdbd (patch) | |
| tree | a9309c0bb177631b1229899b0d7c427935e4bfab | |
| parent | 476066e89d6f0bb87220da690b8a476bf9655b80 (diff) | |
| download | emacs-c7e4bc974b7ec3d6fdae105df05fc19a2cf9fdbd.tar.gz emacs-c7e4bc974b7ec3d6fdae105df05fc19a2cf9fdbd.zip | |
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)
| -rw-r--r-- | lisp/progmodes/xref.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 9522d7e475b..6974d000483 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -694,8 +694,10 @@ references displayed in the current *xref* buffer." | |||
| 694 | (let ((backward (< n 0)) | 694 | (let ((backward (< n 0)) |
| 695 | (n (abs n)) | 695 | (n (abs n)) |
| 696 | (xref nil)) | 696 | (xref nil)) |
| 697 | (dotimes (_ n) | 697 | (if (= n 0) |
| 698 | (setq xref (xref--search-property 'xref-item backward))) | 698 | (setq xref (get-text-property (point) 'xref-item)) |
| 699 | (dotimes (_ n) | ||
| 700 | (setq xref (xref--search-property 'xref-item backward)))) | ||
| 699 | (cond (xref | 701 | (cond (xref |
| 700 | ;; Save the current position (when the buffer is visible, | 702 | ;; Save the current position (when the buffer is visible, |
| 701 | ;; it gets reset to that window's point from time to time). | 703 | ;; it gets reset to that window's point from time to time). |