Use flyspell if its minor mode is active

Fixes #160
Fixes #161
This commit is contained in:
MadAnd 2016-07-02 15:08:30 +03:00 committed by Oleh Krehel
parent b522bfe320
commit 20ecb9bed6

14
avy.el
View File

@ -540,12 +540,14 @@ Set `avy-style' according to COMMMAND as well."
"Auto correct word at PT." "Auto correct word at PT."
(save-excursion (save-excursion
(goto-char pt) (goto-char pt)
(if (looking-at-p "\\b") (if (bound-and-true-p flyspell-mode)
(ispell-word) (flyspell-correct-word-before-point)
(progn (if (looking-at-p "\\b")
(backward-word) (ispell-word)
(when (looking-at-p "\\b") (progn
(ispell-word)))))) (backward-word)
(when (looking-at-p "\\b")
(ispell-word)))))))
(defun avy--process (candidates overlay-fn) (defun avy--process (candidates overlay-fn)
"Select one of CANDIDATES using `avy-read'. "Select one of CANDIDATES using `avy-read'.