mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-11 13:07:28 -05:00
tweak(syntax): hide posframe on next user input
Close: #7813 Ref: #6416 Co-authored-by: Dev380 <Dev380@users.noreply.github.com>
This commit is contained in:
@ -74,6 +74,21 @@
|
||||
(setq flycheck-posframe-warning-prefix "! "
|
||||
flycheck-posframe-info-prefix "··· "
|
||||
flycheck-posframe-error-prefix "X ")
|
||||
|
||||
;; HACK: Hide the flycheck posframe immediately on the next keypress/user
|
||||
;; action, otherwise it lingers until the next time the user is idle.
|
||||
(defun +syntax--flycheck-posframe-hide-h ()
|
||||
(unless (flycheck-posframe-check-position)
|
||||
(posframe-hide flycheck-posframe-buffer))
|
||||
(remove-hook 'post-command-hook #'+syntax--flycheck-posframe-hide-h))
|
||||
|
||||
(defadvice! +syntax-hide-posframe-on-next-command-a (fn &rest args)
|
||||
:around #'flycheck-posframe-show-posframe
|
||||
(letf! ((defun posframe-show (&rest args)
|
||||
(add-hook 'post-command-hook #'+syntax--flycheck-posframe-hide-h)
|
||||
(apply posframe-show args)))
|
||||
(apply fn args)))
|
||||
|
||||
(after! company
|
||||
;; Don't display popups if company is open
|
||||
(add-hook 'flycheck-posframe-inhibit-functions #'company--active-p))
|
||||
|
Reference in New Issue
Block a user