fix(syntax): flycheck popups clearing active region
Moving the cursor over a flycheck-highlighted error will display the error message in a popup. Displaying that popup could clear the active selection (#7242), which is disruptive. This only affected non-Evil users and users not using the module's +childframe flag, but should no longer affect anyone after this commit. Fix: #7242 Ref: flycheck/flycheck-popup-tip#14
This commit is contained in:
parent
bf860138f2
commit
fdf2da903c
1 changed files with 13 additions and 10 deletions
|
@ -51,16 +51,19 @@
|
||||||
:hook (flycheck-mode . +syntax-init-popups-h)
|
:hook (flycheck-mode . +syntax-init-popups-h)
|
||||||
:config
|
:config
|
||||||
(setq flycheck-popup-tip-error-prefix "X ")
|
(setq flycheck-popup-tip-error-prefix "X ")
|
||||||
(after! evil
|
|
||||||
;; Don't display popups while in insert or replace mode, as it can affect
|
;; HACK: Only display the flycheck popup if we're in normal mode (for evil
|
||||||
;; the cursor's position or cause disruptive input delays.
|
;; users) or if no selection or completion is active. This popup can
|
||||||
(add-hook! '(evil-insert-state-entry-hook evil-replace-state-entry-hook)
|
;; interfere with the active evil mode, clear active regions, and other
|
||||||
#'flycheck-popup-tip-delete-popup)
|
;; funny business (see #7242).
|
||||||
(defadvice! +syntax--disable-flycheck-popup-tip-maybe-a (&rest _)
|
(defadvice! +syntax--disable-flycheck-popup-tip-maybe-a (&rest _)
|
||||||
:before-while #'flycheck-popup-tip-show-popup
|
:before-while #'flycheck-popup-tip-show-popup
|
||||||
(if evil-local-mode
|
(if (and (bound-and-true-p evil-local-mode)
|
||||||
(eq evil-state 'normal)
|
(not (evil-emacs-state-p)))
|
||||||
(not (bound-and-true-p company-backend))))))
|
(evil-normal-state-p)
|
||||||
|
(and (not (region-active-p))
|
||||||
|
(not (bound-and-true-p company-backend))
|
||||||
|
(not (ignore-errors (>= corfu--index 0)))))))
|
||||||
|
|
||||||
|
|
||||||
(use-package! flycheck-posframe
|
(use-package! flycheck-posframe
|
||||||
|
|
Loading…
Reference in a new issue