(fix): fix update-tags to correct delete removed tags (#760)

see https://github.com/org-roam/org-roam/pull/759#discussion_r435704588
This commit is contained in:
Tim Quelch 2020-06-05 16:33:39 +10:00 committed by GitHub
parent 5d25c4552d
commit fdaf07da43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -332,12 +332,13 @@ connections, nil is returned."
(defun org-roam-db--update-tags ()
"Update the tags of the current buffer into the cache."
(when-let ((file (file-truename (buffer-file-name)))
(tags (org-roam--extract-tags)))
(let ((file (file-truename (buffer-file-name)))
(tags (org-roam--extract-tags)))
(org-roam-db-query [:delete :from tags
:where (= file $s1)]
file)
(org-roam-db--insert-tags file tags)))
(when tags
(org-roam-db--insert-tags file tags))))
(defun org-roam-db--update-refs ()
"Update the ref of the current buffer into the cache."