From cf07bac3839ba58245bab1558c45701b1340c7b0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 28 Feb 2019 14:18:12 -0500 Subject: [PATCH] Fix persisted workspace storing broken posframes #1017 Not confident this is the best solution, but it will work for now. --- modules/completion/ivy/config.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index cca0f2969..bc1232bf8 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -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)))