avy.el (avy-action-ispell): Adjust for avy-goto-line

Fixes #191
This commit is contained in:
Oleh Krehel 2017-12-10 20:04:37 +01:00
parent 78392e670e
commit 7f83bbc645

22
avy.el
View File

@ -696,14 +696,20 @@ 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 (bound-and-true-p flyspell-mode) (cond
(flyspell-correct-word-before-point) ((eq avy-command 'avy-goto-line)
(if (looking-at-p "\\b") (ispell-region
(ispell-word) (line-beginning-position)
(progn (line-end-position)))
(backward-word) ((bound-and-true-p flyspell-mode)
(when (looking-at-p "\\b") (flyspell-correct-word-before-point))
(ispell-word))))))) ((looking-at-p "\\b")
(ispell-word))
(t
(progn
(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'.