mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(db)fix: FOREIGN KEY error in narrowed buffer (#2215)
When trying to save from a narrowed buffer, only the Roam nodes visible in the narrowed buffer are written to the database. This commit ensures that org-roam behaves the same whether the current buffer is narrowed or not.
This commit is contained in:
@ -381,12 +381,13 @@ If UPDATE-P is non-nil, first remove the file in the database."
|
||||
|
||||
(defun org-roam-db-map-nodes (fns)
|
||||
"Run FNS over all nodes in the current buffer."
|
||||
(org-map-region
|
||||
(lambda ()
|
||||
(when (org-roam-db-node-p)
|
||||
(dolist (fn fns)
|
||||
(funcall fn))))
|
||||
(point-min) (point-max)))
|
||||
(org-with-wide-buffer
|
||||
(org-map-region
|
||||
(lambda ()
|
||||
(when (org-roam-db-node-p)
|
||||
(dolist (fn fns)
|
||||
(funcall fn))))
|
||||
(point-min) (point-max))))
|
||||
|
||||
(defun org-roam-db-map-links (fns)
|
||||
"Run FNS over all links in the current buffer."
|
||||
|
Reference in New Issue
Block a user