(fix): fix 'ref context not returning path to file (#678)

This commit is contained in:
Jethro Kuan
2020-05-21 13:14:06 +08:00
committed by GitHub
parent c4189ffa04
commit dd2406ec92

View File

@ -265,8 +265,9 @@ This function is used solely in Org-roam's capture templates: see
('ref ('ref
(let ((completions (org-roam--get-ref-path-completions)) (let ((completions (org-roam--get-ref-path-completions))
(ref (cdr (assoc 'ref org-roam-capture--info)))) (ref (cdr (assoc 'ref org-roam-capture--info))))
(or (cdr (assoc ref completions)) (if-let ((pl (cdr (assoc ref completions))))
(org-roam-capture--new-file)))) (plist-get pl :path)
(org-roam-capture--new-file))))
(_ (error "Invalid org-roam-capture-context"))))) (_ (error "Invalid org-roam-capture-context")))))
(org-roam-capture--expand-template) (org-roam-capture--expand-template)
(org-roam-capture--put :file-path file-path) (org-roam-capture--put :file-path file-path)