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.
This commit is contained in:
Henrik Lissner 2019-10-19 17:01:31 -04:00
parent 8b5b3deaba
commit ad677433ef
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -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.