avy.el (avy-process): Restart on fail for avy-style 'words

Fixes #283
This commit is contained in:
Federico Tedin 2019-09-05 00:37:21 +02:00 committed by Oleh Krehel
parent 034de4c0e9
commit 5127f993f9

9
avy.el
View File

@ -451,7 +451,8 @@ KEYS is the path from the root of `avy-tree' to LEAF."
"The default handler for a bad CHAR."
(let (dispatch)
(cond ((setq dispatch (assoc char avy-dispatch-alist))
(setq avy-action (cdr dispatch))
(unless (eq avy-style 'words)
(setq avy-action (cdr dispatch)))
(throw 'done 'restart))
((memq char '(?\e ?\C-g))
;; exit silently
@ -862,8 +863,10 @@ multiple OVERLAY-FN invocations."
(res (avy--process-1 candidates overlay-fn cleanup-fn)))
(cond
((null res)
(message "zero candidates")
t)
(if (eq avy-style 'words)
(avy-process original-cands overlay-fn cleanup-fn)
(message "zero candidates")
t))
((eq res 'restart)
(avy-process original-cands overlay-fn cleanup-fn))
;; ignore exit from `avy-handler-function'