branch: master
commit 528125e096e1eb528b97776a6abc9ad79398acf9
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
avy.el (avy--process): Add window to candidates if not present
`avy-read-de-bruijn' relies on the window being the cdr of each
candidate.
Fixes abo-abo/ace-link#22
---
avy.el | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/avy.el b/avy.el
index ae0f22b..1291834 100644
--- a/avy.el
+++ b/avy.el
@@ -485,6 +485,11 @@ Set `avy-style' according to COMMMAND as well."
(defun avy--process (candidates overlay-fn)
"Select one of CANDIDATES using `avy-read'.
Use OVERLAY-FN to visualize the decision overlay."
+ (unless (and (consp (car candidates))
+ (windowp (cdar candidates)))
+ (setq candidates
+ (mapcar (lambda (x) (cons x (selected-window)))
+ candidates)))
(let ((len (length candidates))
(cands (copy-sequence candidates))
res)