Prevent flycheck-correct if region/insert mode is active

This commit is contained in:
Henrik Lissner 2020-01-20 22:23:40 -05:00
parent 8a01ef9082
commit 206d0d9d92
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -75,10 +75,15 @@ e.g. proselint and langtool."
;; used in their respective major modes.
(add-hook 'flyspell-mode-hook #'+spell-init-flyspell-predicate-h)
(let ((flyspell-correct
(general-predicate-dispatch nil
(and (not (or mark-active (ignore-errors (evil-insert-state-p))))
(memq 'flyspell-incorrect (face-at-point nil t)))
#'flyspell-correct-at-point)))
(map! :map flyspell-mouse-map
"RET" #'flyspell-correct-at-point
[return] #'flyspell-correct-at-point
[mouse-1] #'flyspell-correct-at-point))
"RET" flyspell-correct
[return] flyspell-correct
[mouse-1] #'flyspell-correct-at-point)))
(use-package! flyspell-correct