emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 7f83bbc 059/110: avy.el (avy-action-ispell): Adjust for av


From: Oleh Krehel
Subject: [elpa] master 7f83bbc 059/110: avy.el (avy-action-ispell): Adjust for avy-goto-line
Date: Sat, 11 May 2019 10:15:44 -0400 (EDT)

branch: master
commit 7f83bbc6455998ccffcae77f07e875862af05620
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    avy.el (avy-action-ispell): Adjust for avy-goto-line
    
    Fixes #191
---
 avy.el | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/avy.el b/avy.el
index 9eb2652..977dcb6 100644
--- a/avy.el
+++ b/avy.el
@@ -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'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]