From ad677433efd57162dd6efea5adf5586584d436ef Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 19 Oct 2019 17:01:31 -0400 Subject: [PATCH] tools/flycheck: inhibit popups when company is in use Should only appear if in normal mode or, if evil is disabled, when company isn't active. --- modules/tools/flycheck/config.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/tools/flycheck/config.el b/modules/tools/flycheck/config.el index 9c73f5a00..7604086f7 100644 --- a/modules/tools/flycheck/config.el +++ b/modules/tools/flycheck/config.el @@ -39,10 +39,11 @@ errors.") ;; the cursor's position or cause disruptive input delays. (add-hook! '(evil-insert-state-entry-hook evil-replace-state-entry-hook) #'flycheck-popup-tip-delete-popup) - (defadvice! +flycheck--disable-popup-tip-in-insert-mode-a (&rest _) + (defadvice! +flycheck--disable-popup-tip-maybe-a (&rest _) :before-while #'flycheck-popup-tip-show-popup - (or (not evil-local-mode) - (not (memq evil-state '(insert replace))))))) + (if evil-local-mode + (eq evil-state 'normal) + (not (bound-and-true-p company-backend)))))) (use-package! flycheck-posframe @@ -54,6 +55,9 @@ errors.") (setq flycheck-posframe-warning-prefix "⚠ " flycheck-posframe-info-prefix "··· " flycheck-posframe-error-prefix "✕ ") + (after! company + ;; Don't display popups if company is open + (add-hook 'flycheck-posframe-inhibit-functions #'company--active-p)) (after! evil ;; Don't display popups while in insert or replace mode, as it can affect ;; the cursor's position or cause disruptive input delays.