branch: elpa/helm commit e75b285a4a0b503194b8c12fc5cf01fd954b0ecf Author: Thierry Volpiatto <thie...@posteo.net> Commit: Thierry Volpiatto <thie...@posteo.net>
Save-match-data for safety even if the match-data doesn't belong from the same string. --- helm-files.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/helm-files.el b/helm-files.el index 970cdd1fde..55485b8325 100644 --- a/helm-files.el +++ b/helm-files.el @@ -2417,9 +2417,10 @@ COUNT is used for incrementing new name if needed." ;; search and replace ;; feature in placeholder \@. (string-match "\\\\@/\\(.*\\)/\\(.*\\)/" rep) - (helm-aand (replace-regexp-in-string - "\\\\#" (format "%03d" (1+ count)) - (match-string 2 rep)) + (helm-aand (save-match-data + (replace-regexp-in-string + "\\\\#" (format "%03d" (1+ count)) + (match-string 2 rep))) (replace-regexp-in-string (match-string 1 rep) it target))) ;; Incremental replacement