New command: doom/other-popup #141

Like other-window, but for doom popups. Also bound this to `C-x p` in
private module.
This commit is contained in:
Henrik Lissner 2017-07-06 17:45:11 +02:00
parent 8c3693ed47
commit 99b6274b03
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 19 additions and 0 deletions

View file

@ -189,3 +189,19 @@ only close popups that have an :autoclose property in their rule (see
collect `(set! :popup ,@rule))
,@body
(setq shackle-rules old-shackle-rules)))
;;;###autoload
(defun doom/other-popup (count)
"Cycle through popup windows. Like `other-window', but for popups."
(interactive "p")
(if-let (popups (if (doom-popup-p)
(cdr (memq (selected-window) doom-popup-windows))
(setq doom-popup-other-window (selected-window))
doom-popup-windows))
(select-window (nth (mod (1- count) (length popups)) popups))
(unless (eq (selected-window) doom-popup-other-window)
(when doom-popup-other-window
(select-window doom-popup-other-window t)
(cl-decf count))
(when (/= count 0)
(other-window count)))))

View file

@ -66,6 +66,9 @@
:m "A-j" #'+hlissner:multi-next-line
:m "A-k" #'+hlissner:multi-previous-line
(:prefix "C-x"
"p" #'doom/other-popup)
;; --- <leader> -------------------------------------
(:leader