(fix): fix title change not triggering rename if new title contains old (#1315)

title

Fixes #1303
master
Jethro Kuan 5 years ago committed by GitHub
parent 1b598a4618
commit bf41352c1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      org-roam.el

@ -1401,7 +1401,7 @@ To be added to `org-roam-title-change-hook'."
(when (string-match-p old-slug file-name)
(let* ((new-slug (funcall org-roam-title-to-slug-function new-title))
(new-file-name (replace-regexp-in-string old-slug new-slug file-name)))
(unless (string-match-p file-name new-file-name)
(unless (string-equal file-name new-file-name)
(rename-file file-name new-file-name)
(set-visited-file-name new-file-name t t)
(org-roam-db-update)

Loading…
Cancel
Save