mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
Fix link replacement optimization
We are searching for a string literal for speed, so don’t treat it as a
regexp.
Fixes: fc8638759b
("feat: Limit link replacement scope")
Fixes: #2529
This commit is contained in:
@ -810,10 +810,9 @@ Assumes that the cursor was put where the link is."
|
||||
(defun org-roam-link-replace-all ()
|
||||
"Replace all \"roam:\" links in buffer with \"id:\" links."
|
||||
(interactive)
|
||||
(let ((org-roam-link-prefix (concat "[[" org-roam-link-type ":")))
|
||||
(org-with-point-at 1
|
||||
(while (re-search-forward org-roam-link-prefix nil t)
|
||||
(org-roam-link-replace-at-point)))))
|
||||
(org-with-point-at 1
|
||||
(while (search-forward (concat "[[" org-roam-link-type ":") nil t)
|
||||
(org-roam-link-replace-at-point))))
|
||||
|
||||
(add-hook 'org-roam-find-file-hook #'org-roam--replace-roam-links-on-save-h)
|
||||
(defun org-roam--replace-roam-links-on-save-h ()
|
||||
|
Reference in New Issue
Block a user