Add :fixed property to popup rules
This commit is contained in:
parent
9de6518906
commit
cfb094e589
2 changed files with 15 additions and 10 deletions
|
@ -186,13 +186,6 @@ window parameter."
|
||||||
((or 'left 'right) (window-width window))
|
((or 'left 'right) (window-width window))
|
||||||
((or 'above 'below) (window-height window))))
|
((or 'above 'below) (window-height window))))
|
||||||
|
|
||||||
(defun doom--popup-data (window)
|
|
||||||
(when-let (buffer (window-buffer window))
|
|
||||||
`(,(buffer-name buffer)
|
|
||||||
:file ,(buffer-file-name buffer)
|
|
||||||
:rules ,(window-parameter window 'popup)
|
|
||||||
:size ,(doom-popup-size window))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defmacro with-popup-rules! (rules &rest body)
|
(defmacro with-popup-rules! (rules &rest body)
|
||||||
"TODO"
|
"TODO"
|
||||||
|
@ -218,3 +211,11 @@ window parameter."
|
||||||
(cl-decf count))
|
(cl-decf count))
|
||||||
(when (/= count 0)
|
(when (/= count 0)
|
||||||
(other-window count)))))
|
(other-window count)))))
|
||||||
|
|
||||||
|
(defun doom--popup-data (window)
|
||||||
|
(unless (doom-popup-property :fixed window)
|
||||||
|
(when-let (buffer (window-buffer window))
|
||||||
|
`(,(buffer-name buffer)
|
||||||
|
:file ,(buffer-file-name buffer)
|
||||||
|
:rules ,(window-parameter window 'popup)
|
||||||
|
:size ,(doom-popup-size window)))))
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
"The shackle rule that caused this buffer to be recognized as a popup.")
|
"The shackle rule that caused this buffer to be recognized as a popup.")
|
||||||
|
|
||||||
(defvar doom-popup-window-parameters
|
(defvar doom-popup-window-parameters
|
||||||
'(:noesc :modeline :autokill :autoclose)
|
'(:noesc :modeline :autokill :autoclose :fixed)
|
||||||
"A list of window parameters that are set (and cleared) when `doom-popup-mode
|
"A list of window parameters that are set (and cleared) when `doom-popup-mode
|
||||||
is enabled/disabled.'")
|
is enabled/disabled.'")
|
||||||
|
|
||||||
|
@ -63,7 +63,11 @@ recognized by DOOM's popup system. They are:
|
||||||
that have an :autokill property.
|
that have an :autokill property.
|
||||||
|
|
||||||
:autoclose If non-nil, close popup if ESC is pressed from outside
|
:autoclose If non-nil, close popup if ESC is pressed from outside
|
||||||
the popup window."
|
the popup window.
|
||||||
|
|
||||||
|
:fixed If non-nil, don't treat this window like a popup. This makes it
|
||||||
|
impervious to being automatically closed or tracked in popup
|
||||||
|
history. Excellent for permanent sidebars."
|
||||||
(if (cl-every #'listp (mapcar #'doom-unquote rules))
|
(if (cl-every #'listp (mapcar #'doom-unquote rules))
|
||||||
`(setq shackle-rules (nconc (list ,@rules) shackle-rules))
|
`(setq shackle-rules (nconc (list ,@rules) shackle-rules))
|
||||||
`(push (list ,@rules) shackle-rules)))
|
`(push (list ,@rules) shackle-rules)))
|
||||||
|
@ -509,7 +513,7 @@ the command buffer."
|
||||||
;;
|
;;
|
||||||
;; By handing neotree over to shackle, which is better integrated into the
|
;; By handing neotree over to shackle, which is better integrated into the
|
||||||
;; rest of my config (and persp-mode), this is no longer a problem.
|
;; rest of my config (and persp-mode), this is no longer a problem.
|
||||||
(set! :popup " *NeoTree*" :align neo-window-position :size neo-window-width)
|
(set! :popup " *NeoTree*" :align neo-window-position :size neo-window-width :fixed t)
|
||||||
|
|
||||||
(defun +evil-neotree-display-fn (buf _alist)
|
(defun +evil-neotree-display-fn (buf _alist)
|
||||||
"Hand neotree off to shackle."
|
"Hand neotree off to shackle."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue