(fix):org-roam-refile: Don't try to refile a node into itself (#1928)

This commit is contained in:
Amir Dekel
2021-10-29 10:07:25 +02:00
committed by GitHub
parent d0fd2c6959
commit 1b221a1d4a

View File

@ -827,6 +827,8 @@ If region is active, then use it instead of the node at point."
(nbuf (or (find-buffer-visiting file)
(find-file-noselect file)))
level reversed)
(if (equal (org-roam-node-at-point) node)
(user-error "Target is the same as current node")
(if regionp
(progn
(org-kill-new (buffer-substring region-start region-end))
@ -868,7 +870,7 @@ If region is active, then use it instead of the node at point."
(when (and org-capture-mode
(buffer-base-buffer (current-buffer)))
(org-capture-kill))
(kill-buffer (current-buffer)))))
(kill-buffer (current-buffer))))))
;;;###autoload
(defun org-roam-extract-subtree ()