Smarter RET in normal mode over flyspell regions
Will now trigger flyspell-correct-word-generic
This commit is contained in:
parent
db2949ff32
commit
594df64913
2 changed files with 13 additions and 0 deletions
|
@ -55,6 +55,12 @@
|
|||
(fboundp 'evilmi-jump-items)
|
||||
'evilmi-jump-items)
|
||||
|
||||
;; Smarter RET in normal mode
|
||||
:n "RET" (general-predicate-dispatch nil
|
||||
(and (bound-and-true-p flyspell-mode)
|
||||
(+flyspell-correction-at-point-p))
|
||||
'flyspell-correct-word-generic)
|
||||
|
||||
;; Smarter newlines
|
||||
:i [remap newline] #'newline-and-indent ; auto-indent on newline
|
||||
:i "C-j" #'+default/newline ; default behavior
|
||||
|
|
|
@ -14,3 +14,10 @@
|
|||
"TODO"
|
||||
(when-let* ((pred (assq major-mode +flyspell--predicate-alist)))
|
||||
(setq-local flyspell-generic-check-word-predicate (cdr pred))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +flyspell-correction-at-point-p (&optional point)
|
||||
"TODO"
|
||||
(cl-loop for ov in (overlays-at (or point (point)))
|
||||
if (overlay-get ov 'flyspell-overlay)
|
||||
return t))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue