(fix): fix backlinks in org-roam buffer (#1099)

previously when the file is a symbolic link, the backlinks buffer display will not show correctly.
This commit is contained in:
Richard Kim
2020-09-12 10:48:07 -07:00
committed by GitHub
parent fac0465dd8
commit 70539c40d2

View File

@@ -110,7 +110,7 @@ For example: (setq org-roam-buffer-window-parameters '((no-other-window . t)))"
(defun org-roam-buffer--insert-title ()
"Insert the org-roam-buffer title."
(insert (propertize (org-roam--get-title-or-slug
(buffer-file-name org-roam-buffer--current))
(file-truename (buffer-file-name org-roam-buffer--current)))
'font-lock-face
'org-document-title)))
@@ -152,7 +152,7 @@ For example: (setq org-roam-buffer-window-parameters '((no-other-window . t)))"
(defun org-roam-buffer--insert-backlinks ()
"Insert the org-roam-buffer backlinks string for the current buffer."
(if-let* ((file-path (buffer-file-name org-roam-buffer--current))
(if-let* ((file-path (file-truename (buffer-file-name org-roam-buffer--current)))
(titles (with-current-buffer org-roam-buffer--current
(org-roam--extract-titles)))
(backlinks (org-roam--get-backlinks (push file-path titles)))