Slightly better popper window management, still WIP
This commit is contained in:
parent
920e98bb32
commit
68bcc8c697
@ -728,7 +728,7 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
|
|||||||
helpful-mode))
|
helpful-mode))
|
||||||
|
|
||||||
(global-set-key (kbd "C-`") 'popper-toggle-latest)
|
(global-set-key (kbd "C-`") 'popper-toggle-latest)
|
||||||
(global-set-key (kbd "M-`") 'popper-cycle)
|
(global-set-key (kbd "C-~") 'popper-cycle)
|
||||||
(global-set-key (kbd "C-M-`") 'popper-toggle-type)
|
(global-set-key (kbd "C-M-`") 'popper-toggle-type)
|
||||||
(require 'popper-echo)
|
(require 'popper-echo)
|
||||||
(popper-echo-mode t)
|
(popper-echo-mode t)
|
||||||
@ -741,12 +741,29 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
|
|||||||
|
|
||||||
;; TODO Consider adding checks for vertical splits and only popup on right if so
|
;; TODO Consider adding checks for vertical splits and only popup on right if so
|
||||||
(defun joe/popper-display-func (buffer &optional _alist)
|
(defun joe/popper-display-func (buffer &optional _alist)
|
||||||
(display-buffer-in-direction
|
(cond
|
||||||
buffer
|
((cl-find-if
|
||||||
`((window-height . 0.4)
|
(lambda (window)
|
||||||
(window-width . 0.4)
|
(with-current-buffer (window-buffer window) popper-popup-status))
|
||||||
(direction . ,(joe/get-popper-dir))
|
(window-list))
|
||||||
(body-function . ,#'select-window))))
|
(display-buffer-reuse-window
|
||||||
|
buffer
|
||||||
|
`((body-function . ,#'select-window))))
|
||||||
|
((and (not (window-in-direction 'right))
|
||||||
|
(not (window-in-direction 'left)))
|
||||||
|
(display-buffer-in-direction
|
||||||
|
buffer
|
||||||
|
`((window-height . 0.4)
|
||||||
|
(window-width . 0.4)
|
||||||
|
(direction . right)
|
||||||
|
(body-function . ,#'select-window))))
|
||||||
|
(t
|
||||||
|
(display-buffer-in-direction
|
||||||
|
buffer
|
||||||
|
`((window-height . 0.4)
|
||||||
|
(window-width . 0.4)
|
||||||
|
(direction . below)
|
||||||
|
(body-function . ,#'select-window))))))
|
||||||
|
|
||||||
(setq popper-display-function #'joe/popper-display-func)
|
(setq popper-display-function #'joe/popper-display-func)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user