emacs-diffs
[Top][All Lists]
Advanced

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

master 9b31ad3: * lisp/progmodes/xref.el (xref--collect-matches): Widen


From: Juri Linkov
Subject: master 9b31ad3: * lisp/progmodes/xref.el (xref--collect-matches): Widen temporarily.
Date: Wed, 18 Aug 2021 13:02:54 -0400 (EDT)

branch: master
commit 9b31ad36094666da6b3281025adc163829d89de8
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/progmodes/xref.el (xref--collect-matches): Widen temporarily.
---
 lisp/progmodes/xref.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 69378a5..d3780d5 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1729,12 +1729,14 @@ Such as the current syntax table and the applied syntax 
properties."
     (if buf
         (with-current-buffer buf
           (save-excursion
-            (goto-char (point-min))
-            (forward-line (1- line))
-            (xref--collect-matches-1 regexp file line
-                                     (line-beginning-position)
-                                     (line-end-position)
-                                     syntax-needed)))
+            (save-restriction
+              (widen)
+              (goto-char (point-min))
+              (forward-line (1- line))
+              (xref--collect-matches-1 regexp file line
+                                       (line-beginning-position)
+                                       (line-end-position)
+                                       syntax-needed))))
       ;; Using the temporary buffer is both a performance and a buffer
       ;; management optimization.
       (with-current-buffer tmp-buffer



reply via email to

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