(fix): save-restriction for db update (#1016)

This commit is contained in:
Jethro Kuan
2020-08-09 12:06:34 +08:00
committed by GitHub
parent c437052b4b
commit 6d03e7626d

View File

@ -455,9 +455,7 @@ connections, nil is returned."
(find-file-noselect file-path t)) (find-file-noselect file-path t))
(current-buffer)))) (current-buffer))))
(with-current-buffer buf (with-current-buffer buf
(save-excursion (org-with-wide-buffer
(save-restriction
(widen)
(emacsql-with-transaction (org-roam-db) (emacsql-with-transaction (org-roam-db)
(org-roam-db--update-meta) (org-roam-db--update-meta)
(org-roam-db--update-tags) (org-roam-db--update-tags)
@ -465,7 +463,7 @@ connections, nil is returned."
(org-roam-db--update-refs) (org-roam-db--update-refs)
(org-roam-db--update-headlines) (org-roam-db--update-headlines)
(org-roam-db--update-links))) (org-roam-db--update-links)))
(org-roam-buffer--update-maybe :redisplay t)))))) (org-roam-buffer--update-maybe :redisplay t)))))
(defun org-roam-db-build-cache (&optional force) (defun org-roam-db-build-cache (&optional force)
"Build the cache for `org-roam-directory'. "Build the cache for `org-roam-directory'.