Add window selection via mouse button press and fix typo

This commit is contained in:
Bob Weiner 2017-12-08 15:20:41 -05:00 committed by Oleh Krehel
parent 793a5e22a7
commit 9489ca9064

14
avy.el
View File

@ -465,15 +465,19 @@ multiple DISPLAY-FN invocations."
(dolist (x avy--leafs)
(funcall display-fn (car x) (cdr x))))
(let ((char (funcall avy-translate-char-function (read-key)))
window
branch)
(funcall cleanup-fn)
(if (setq branch (assoc char tree))
(progn
(if (setq window (avy-mouse-event-window char))
(throw 'done (cons char window))
;; Ensure avy-current-path stores the full path given before
;; exit for testing when an invalid path character is given.
(setq avy-current-path
(concat avy-current-path (string (avy--key-to-char char))))
(when (eq (car (setq tree (cdr branch))) 'leaf)
(throw 'done (cdr tree))))
(funcall avy-handler-function char))))))
(if (setq branch (assoc char tree))
(if (eq (car (setq tree (cdr branch))) 'leaf)
(throw 'done (cdr tree)))
(funcall avy-handler-function char)))))))
(defun avy-read-de-bruijn (lst keys)
"Select from LST dispatching on KEYS."