From c78c272f118dc5b02d0457d25fb77e63bdff05ee Mon Sep 17 00:00:00 2001 From: Zediu Almos Date: Tue, 7 Sep 2021 15:36:53 +0300 Subject: Note opens in new window, if current isn't Roam --- org-roam-ui.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'org-roam-ui.el') 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)) -- cgit v1.2.3 From 5eaa8850d9e8bc87d8cef6e847acb56fca1d85b9 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Sat, 11 Sep 2021 18:24:45 +0200 Subject: fix: don't open roam buffers on top of other buffers #82 --- org-roam-ui.el | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'org-roam-ui.el') diff --git a/org-roam-ui.el b/org-roam-ui.el index 2c5dd3a..85f9e97 100644 --- a/org-roam-ui.el +++ b/org-roam-ui.el @@ -175,13 +175,9 @@ This serves the web-build and API over HTTP." (command (alist-get 'command msg)) (data (alist-get 'data msg))) (cond ((string= command "open") - (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))) + :id (alist-get 'id data))) (not (org-roam-buffer-p)))) ((string= command "delete") (progn (message "Deleted %s" (alist-get 'file data)) -- cgit v1.2.3