branch: externals/avy
commit aadca9308aab8aa1ac9e7146d999b6e38f764e90
Author: Oleh Krehel <ohwoeo...@gmail.com>
Commit: Oleh Krehel <ohwoeo...@gmail.com>

    avy.el (avy-resume): Work better for avy-goto-timer
    
    Fixes #277
---
 avy.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/avy.el b/avy.el
index a0dbd35288..0990d4994e 100644
--- a/avy.el
+++ b/avy.el
@@ -665,7 +665,9 @@ Set `avy-style' according to COMMMAND as well."
      (setf (symbol-function 'avy-resume)
            (lambda ()
              (interactive)
-             ,@body))
+             ,@(if (eq command 'avy-goto-char-timer)
+                   (cdr body)
+                 body)))
      ,@body))
 
 (defun avy-action-goto (pt)
@@ -2061,6 +2063,8 @@ Otherwise, the whole regex is highlighted."
         (delete-overlay ov))
       (avy--done))))
 
+(defvar avy--old-cands nil)
+
 ;;;###autoload
 (defun avy-goto-char-timer (&optional arg)
   "Read one or many consecutive chars and jump to the first one.
@@ -2070,8 +2074,8 @@ The window scope is determined by `avy-all-windows' (ARG 
negates it)."
                              (not avy-all-windows)
                            avy-all-windows)))
     (avy-with avy-goto-char-timer
-      (avy-process
-       (avy--read-candidates)))))
+      (setq avy--old-cands (avy--read-candidates))
+      (avy-process avy--old-cands))))
 
 (defun avy-push-mark ()
   "Store the current point and window."

Reply via email to