branch: externals/substitute commit 67a5f9bcaf936a88607fe9b327faf07a65fccd47 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Reset collection so it is not duplicated --- substitute.el | 1 + 1 file changed, 1 insertion(+) diff --git a/substitute.el b/substitute.el index 27c7ede54b..d9000352c4 100644 --- a/substitute.el +++ b/substitute.el @@ -184,6 +184,7 @@ Each entry is a list of the symbol and its buffer positions.") (defun substitute--collect-targets (target scope) "Store occurrences of TARGET in SCOPE in `substitute--last-matches'." (let ((search-fn (if (eq scope 'above) 're-search-backward 're-search-forward))) + (setq-local substitute--last-matches nil) (save-excursion (save-restriction (substitute--setup-scope target scope)