(fix): fix fuzzy-links opening for file (#1023)

This commit is contained in:
Jethro Kuan 2020-08-10 14:31:10 +08:00 committed by GitHub
parent 0ed9057a87
commit 8c442a72de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1304,15 +1304,14 @@ Three types of fuzzy links are supported:
(org-roam--org-roam-file-p))
(when-let ((location (org-roam--get-fuzzy-link-location link)))
(pcase-let ((`(,link-type ,loc ,desc ,mkr) location))
(when (and (not loc)
(string-equal link-type "file"))
(org-roam-find-file desc nil nil t))
(when (and org-roam-auto-replace-fuzzy-links
loc desc)
(org-roam-replace-fuzzy-link (concat link-type ":" loc) desc))
(pcase link-type
("file"
(org-roam--find-file loc))
(if loc
(org-roam--find-file loc)
(org-roam-find-file desc nil nil t)))
("id"
(org-goto-marker-or-bmk mkr)))))
t))