avy.el (avy-copy-region): Keep same selectors for the second pass

With `avy-all-windows' t, the call to `avy--line' would change the
window.

Fixes #121
Fixes #120
This commit is contained in:
Oleh Krehel 2016-01-05 11:13:18 +01:00
parent 9d18bf9fc2
commit bae6fb15d0

3
avy.el
View File

@ -1167,7 +1167,8 @@ The window scope is determined by `avy-all-windows' or
(interactive "P")
(let ((initial-window (selected-window)))
(avy-with avy-copy-region
(let* ((beg (avy--line arg))
(let* ((beg (save-selected-window
(avy--line arg)))
(end (avy--line arg))
(str (buffer-substring-no-properties
beg