Fix persisted workspace storing broken posframes #1017

Not confident this is the best solution, but it will work for now.
This commit is contained in:
Henrik Lissner 2019-02-28 14:18:12 -05:00
parent ab79799407
commit cf07bac383
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -205,6 +205,10 @@ immediately runs it on the current candidate (ending the ivy session)."
;; default to posframe display function
(setf (alist-get t ivy-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
(dolist (fn '(swiper counsel-ag counsel-grep counsel-git-grep))
(setf (alist-get fn ivy-display-functions-alist) #'ivy-display-function-fallback)))