mirror of
https://github.com/org-roam/org-roam
synced 2025-09-18 16:06:49 -05:00
(feat): add customization to set no-delete-other-windows (#422)
Adds `org-roam-buffer-no-delete-other-windows`, which controls the behaviour of the org-roam buffer side window upon `delete-other-windows`.
This commit is contained in:
@@ -83,6 +83,12 @@ Has an effect if and only if `org-roam-buffer-position' is `top' or `bottom'."
|
|||||||
:type 'hook
|
:type 'hook
|
||||||
:group 'org-roam)
|
:group 'org-roam)
|
||||||
|
|
||||||
|
(defcustom org-roam-buffer-no-delete-other-windows nil
|
||||||
|
"The `no-delete-other-windows' parameter of the `org-roam-buffer' window.
|
||||||
|
When non-nil, the window will not be closed when deleting other windows."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'org-roam)
|
||||||
|
|
||||||
(defalias 'org-roam--current-buffer 'org-roam-buffer--current)
|
(defalias 'org-roam--current-buffer 'org-roam-buffer--current)
|
||||||
(make-obsolete-variable 'org-roam--current-buffer 'org-roam-buffer--current "2020/04/06")
|
(make-obsolete-variable 'org-roam--current-buffer 'org-roam-buffer--current "2020/04/06")
|
||||||
(defvar org-roam-buffer--current nil
|
(defvar org-roam-buffer--current nil
|
||||||
@@ -244,7 +250,8 @@ Valid states are 'visible, 'exists and 'none."
|
|||||||
'right)))
|
'right)))
|
||||||
(-> (get-buffer-create org-roam-buffer)
|
(-> (get-buffer-create org-roam-buffer)
|
||||||
(display-buffer-in-side-window
|
(display-buffer-in-side-window
|
||||||
`((side . ,position)))
|
`((side . ,position)
|
||||||
|
(window-parameters . ((no-delete-other-windows . ,org-roam-buffer-no-delete-other-windows)))))
|
||||||
(select-window))
|
(select-window))
|
||||||
(pcase position
|
(pcase position
|
||||||
((or 'right 'left)
|
((or 'right 'left)
|
||||||
|
Reference in New Issue
Block a user