From b5c5b7f10d21ee0905a568de793f458156669c69 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 25 Jun 2019 11:55:00 +0200 Subject: [PATCH] Move posframe+persp-mode fix to ui/workspaces --- modules/completion/ivy/config.el | 4 ---- modules/ui/workspaces/config.el | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index 54632fd82..1a750a4f0 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -278,10 +278,6 @@ evil-ex-specific constructs, so we disable it solely in evil-ex." ;; default to posframe display function (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 (dolist (fn '(swiper counsel-ag counsel-grep counsel-git-grep)) (setf (alist-get fn ivy-posframe-display-functions-alist) #'ivy-display-function-fallback))) diff --git a/modules/ui/workspaces/config.el b/modules/ui/workspaces/config.el index b2ec31505..2fdf19597 100644 --- a/modules/ui/workspaces/config.el +++ b/modules/ui/workspaces/config.el @@ -166,6 +166,12 @@ stored in `persp-save-dir'.") (ignore-errors (funcall orig-fn))) (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 (persp-def-buffer-save/load