diff options
author | Juri Linkov <juri@linkov.net> | 2021-08-18 20:02:39 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2021-08-18 20:02:39 +0300 |
commit | 9b31ad36094666da6b3281025adc163829d89de8 (patch) | |
tree | fac1d03a996d743243ab1e59648217fd36512afe | |
parent | 1a4ed8ee7843b7cb929f066781a4a754bebf0f4d (diff) | |
download | emacs-9b31ad36094666da6b3281025adc163829d89de8.tar.gz |
* lisp/progmodes/xref.el (xref--collect-matches): Widen temporarily.
-rw-r--r-- | lisp/progmodes/xref.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 69378a561ea..d3780d571fc 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 |