mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 05:23:05 +00:00
parent
c08fc7c1c6
commit
a0ce6a7558
12
avy.el
12
avy.el
@ -434,6 +434,16 @@ KEYS is the path from the root of `avy-tree' to LEAF."
|
||||
(defvar avy-current-path ""
|
||||
"Store the current incomplete path during `avy-read'.")
|
||||
|
||||
(defun avy-mouse-event-window (char)
|
||||
"If CHAR is a mouse event, return the window of the event if any or the selected window.
|
||||
Return nil if not a mouse event."
|
||||
(when (mouse-event-p char)
|
||||
(cond ((windowp (posn-window (event-start char)))
|
||||
(posn-window (event-start char)))
|
||||
((framep (posn-window (event-start char)))
|
||||
(frame-selected-window (posn-window (event-start char))))
|
||||
(t (selected-window)))))
|
||||
|
||||
(defun avy-read (tree display-fn cleanup-fn)
|
||||
"Select a leaf from TREE using consecutive `read-char'.
|
||||
|
||||
@ -442,7 +452,7 @@ associated with CHAR will be selected if CHAR is pressed. This is
|
||||
commonly done by adding a CHAR overlay at LEAF position.
|
||||
|
||||
CLEANUP-FN should take no arguments and remove the effects of
|
||||
multiple DISPLAY-FN invokations."
|
||||
multiple DISPLAY-FN invocations."
|
||||
(catch 'done
|
||||
(setq avy-current-path "")
|
||||
(while tree
|
||||
|
Loading…
x
Reference in New Issue
Block a user