* lisp/progmodes/xref.el (xref--collect-matches): Widen temporarily.

This commit is contained in:
Juri Linkov 2021-08-18 20:02:39 +03:00
parent 1a4ed8ee78
commit 9b31ad3609

View 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