avy.el (avy-read): Don't call `avy--key-to-char' too early

If the key is intended for dispatch, it's not necessary for
`avy--key-to-char' to encode it as a char.
This commit is contained in:
Oleh Krehel 2019-06-30 17:38:41 +02:00
parent 343fc42de1
commit 66886e265c

5
avy.el
View File

@ -518,13 +518,14 @@ multiple DISPLAY-FN invocations."
(funcall cleanup-fn)
(if (setq window (avy-mouse-event-window char))
(throw 'done (cons char window))
(if (setq branch (assoc char tree))
(progn
;; Ensure avy-current-path stores the full path prior to
;; exit so other packages can utilize its value.
(setq avy-current-path
(concat avy-current-path (string (avy--key-to-char char))))
(if (setq branch (assoc char tree))
(if (eq (car (setq tree (cdr branch))) 'leaf)
(throw 'done (cdr tree)))
(throw 'done (cdr tree))))
(funcall avy-handler-function char)))))))
(defun avy-read-de-bruijn (lst keys)