Move posframe+persp-mode fix to ui/workspaces

This commit is contained in:
Henrik Lissner 2019-06-25 11:55:00 +02:00
parent 9823881d47
commit b5c5b7f10d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 6 additions and 4 deletions

View file

@ -278,10 +278,6 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
;; default to posframe display function ;; default to posframe display function
(setf (alist-get t ivy-posframe-display-functions-alist) #'+ivy-display-at-frame-center-near-bottom) (setf (alist-get t ivy-posframe-display-functions-alist) #'+ivy-display-at-frame-center-near-bottom)
;; Fix #1017: stop session persistence from restoring a broken posframe
(defun +workspace|delete-all-posframes (&rest _) (posframe-delete-all))
(add-hook 'persp-after-load-state-functions #'+workspace|delete-all-posframes)
;; posframe doesn't work well with async sources ;; posframe doesn't work well with async sources
(dolist (fn '(swiper counsel-ag counsel-grep counsel-git-grep)) (dolist (fn '(swiper counsel-ag counsel-grep counsel-git-grep))
(setf (alist-get fn ivy-posframe-display-functions-alist) #'ivy-display-function-fallback))) (setf (alist-get fn ivy-posframe-display-functions-alist) #'ivy-display-function-fallback)))

View file

@ -166,6 +166,12 @@ stored in `persp-save-dir'.")
(ignore-errors (funcall orig-fn))) (ignore-errors (funcall orig-fn)))
(advice-add #'persp-kill-emacs-h :around #'+workspaces*ignore-errors-on-kill-emacs) (advice-add #'persp-kill-emacs-h :around #'+workspaces*ignore-errors-on-kill-emacs)
;; Fix #1017: stop session persistence from restoring a broken posframe
(after! posframe
(defun +workspaces|delete-all-posframes (&rest _)
(posframe-delete-all))
(add-hook 'persp-after-load-state-functions #'+workspaces|delete-all-posframes))
;; ;;
;; eshell ;; eshell
(persp-def-buffer-save/load (persp-def-buffer-save/load