From 34c83c0d692ee8c097d747e0dc9756df4e1c8a4b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 19 Feb 2016 12:34:33 -0500 Subject: [PATCH] evil: Smarter closing of popups on evil-force-normal-mode --- core/core-evil.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/core-evil.el b/core/core-evil.el index 18659e1b8..658b68284 100644 --- a/core/core-evil.el +++ b/core/core-evil.el @@ -97,8 +97,14 @@ (narf-minibuffer-quit)) (ignore-errors (evil-ex-nohighlight)) - (unless (bound-and-true-p org-src-mode) - (narf/popup-close))) + ;; Close non-repl popups and clean up `narf-popup-windows' + (mapc (lambda (w) + (if (window-live-p w) + (with-selected-window w + (unless (derived-mode-p 'comint-mode) + (narf/popup-close w))) + (setq narf-popup-windows (delq w narf-popup-windows)))) + narf-popup-windows)) ;; Fix disruptive errors w/ hidden buffers caused by workgroups killing windows ;; TODO Delete timer on dead windows