summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZediu Almos <[email protected]>2021-09-07 15:36:53 +0300
committerZediu Almos <[email protected]>2021-09-07 15:36:53 +0300
commitc78c272f118dc5b02d0457d25fb77e63bdff05ee (patch)
tree981781f8a301c98b5bcc44f701e2b8abe7f0c58b
parent9ad111d2102c24593f6ac012206bb4b2c9c6c4e1 (diff)
Note opens in new window, if current isn't Roam
-rw-r--r--org-roam-ui.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el
index 0afa362..2c5dd3a 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -175,9 +175,13 @@ This serves the web-build and API over HTTP."
(command (alist-get 'command msg))
(data (alist-get 'data msg)))
(cond ((string= command "open")
- (org-roam-node-visit
- (org-roam-populate (org-roam-node-create
- :id (alist-get 'id data)))))
+ (let ((should-open-in-new-window nil))
+ (if (string-match "^[0-9]\\{14\\}-.*\.org$" (buffer-name))
+ (setq should-open-in-new-window nil)
+ (setq should-open-in-new-window t))
+ (org-roam-node-visit
+ (org-roam-populate (org-roam-node-create
+ :id (alist-get 'id data))) should-open-in-new-window)))
((string= command "delete")
(progn
(message "Deleted %s" (alist-get 'file data))