mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 21:33:05 +00:00
avy.el (avy--process): Fix the candidates list being modified when restarting
For example, with multiple windows, `avy-goto-char' followed by "x" would change the overlays to a subset of the overlays in the current window.
This commit is contained in:
parent
7cfe11e3c1
commit
7c40f5e381
5
avy.el
5
avy.el
@ -756,13 +756,14 @@ Use OVERLAY-FN to visualize the decision overlay."
|
|||||||
(setq candidates
|
(setq candidates
|
||||||
(mapcar (lambda (x) (cons x (selected-window)))
|
(mapcar (lambda (x) (cons x (selected-window)))
|
||||||
candidates)))
|
candidates)))
|
||||||
(let ((res (avy--process-1 candidates overlay-fn)))
|
(let ((original-cands (copy-sequence candidates))
|
||||||
|
(res (avy--process-1 candidates overlay-fn)))
|
||||||
(cond
|
(cond
|
||||||
((null res)
|
((null res)
|
||||||
(message "zero candidates")
|
(message "zero candidates")
|
||||||
t)
|
t)
|
||||||
((eq res 'restart)
|
((eq res 'restart)
|
||||||
(avy--process candidates overlay-fn))
|
(avy--process original-cands overlay-fn))
|
||||||
;; ignore exit from `avy-handler-function'
|
;; ignore exit from `avy-handler-function'
|
||||||
((eq res 'exit))
|
((eq res 'exit))
|
||||||
(t
|
(t
|
||||||
|
Loading…
x
Reference in New Issue
Block a user