mirror of
https://github.com/org-roam/org-roam
synced 2025-08-07 12:47:23 -05:00
allow point 0 headings
Check if outline level is 0 at point-min before inserting file-level info. Fixes #1475
This commit is contained in:
@ -266,6 +266,7 @@ If UPDATE-P is non-nil, first remove the file in the database."
|
|||||||
(defun org-roam-db-insert-file-node ()
|
(defun org-roam-db-insert-file-node ()
|
||||||
"Insert the file-level node into the Org-roam cache."
|
"Insert the file-level node into the Org-roam cache."
|
||||||
(org-with-point-at 1
|
(org-with-point-at 1
|
||||||
|
(when (= (org-outline-level) 0)
|
||||||
(when-let ((id (org-id-get)))
|
(when-let ((id (org-id-get)))
|
||||||
(let* ((file (buffer-file-name (buffer-base-buffer)))
|
(let* ((file (buffer-file-name (buffer-base-buffer)))
|
||||||
(title (or (cadr (assoc "TITLE" (org-collect-keywords '("title"))
|
(title (or (cadr (assoc "TITLE" (org-collect-keywords '("title"))
|
||||||
@ -312,7 +313,7 @@ If UPDATE-P is non-nil, first remove the file in the database."
|
|||||||
(org-roam-db-query
|
(org-roam-db-query
|
||||||
[:insert :into refs
|
[:insert :into refs
|
||||||
:values $v1]
|
:values $v1]
|
||||||
rows))))))))
|
rows)))))))))
|
||||||
|
|
||||||
(defun org-roam-db-insert-node-data ()
|
(defun org-roam-db-insert-node-data ()
|
||||||
"Insert node data for headline at point into the Org-roam cache."
|
"Insert node data for headline at point into the Org-roam cache."
|
||||||
|
Reference in New Issue
Block a user