]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/xref.el (xref--collect-matches): Widen temporarily.
authorJuri Linkov <juri@linkov.net>
Wed, 18 Aug 2021 17:02:39 +0000 (20:02 +0300)
committerJuri Linkov <juri@linkov.net>
Wed, 18 Aug 2021 17:02:39 +0000 (20:02 +0300)
lisp/progmodes/xref.el

index 69378a561ea45d66eb29b7335ac944683e919c31..d3780d571fc0e77fdfa436398cc9fb056959e53f 100644 (file)
@@ -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