mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -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 ()
|
||||
"Insert the file-level node into the Org-roam cache."
|
||||
(org-with-point-at 1
|
||||
(when (= (org-outline-level) 0)
|
||||
(when-let ((id (org-id-get)))
|
||||
(let* ((file (buffer-file-name (buffer-base-buffer)))
|
||||
(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
|
||||
[:insert :into refs
|
||||
:values $v1]
|
||||
rows))))))))
|
||||
rows)))))))))
|
||||
|
||||
(defun org-roam-db-insert-node-data ()
|
||||
"Insert node data for headline at point into the Org-roam cache."
|
||||
|
Reference in New Issue
Block a user