diff options
author | Oleh Krehel <ohwoeowho@gmail.com> | 2017-12-10 20:04:37 +0100 |
---|---|---|
committer | Oleh Krehel <ohwoeowho@gmail.com> | 2017-12-10 20:06:35 +0100 |
commit | 7f83bbc6455998ccffcae77f07e875862af05620 (patch) | |
tree | 812ea429c4851c031731dfc91ce37be0a0607368 | |
parent | 78392e670ec12d93e0e169a7fabcd024664e5abe (diff) |
avy.el (avy-action-ispell): Adjust for avy-goto-line
Fixes #191
-rw-r--r-- | avy.el | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -696,14 +696,20 @@ Set `avy-style' according to COMMMAND as well." "Auto correct word at PT." (save-excursion (goto-char pt) - (if (bound-and-true-p flyspell-mode) - (flyspell-correct-word-before-point) - (if (looking-at-p "\\b") - (ispell-word) - (progn - (backward-word) - (when (looking-at-p "\\b") - (ispell-word))))))) + (cond + ((eq avy-command 'avy-goto-line) + (ispell-region + (line-beginning-position) + (line-end-position))) + ((bound-and-true-p flyspell-mode) + (flyspell-correct-word-before-point)) + ((looking-at-p "\\b") + (ispell-word)) + (t + (progn + (backward-word) + (when (looking-at-p "\\b") + (ispell-word))))))) (defun avy--process (candidates overlay-fn) "Select one of CANDIDATES using `avy-read'. |