avy.el (avy-move-region): Insert in original window

Fixes #187
This commit is contained in:
Oleh Krehel 2017-04-02 10:12:22 +02:00
parent 0c30cdba9e
commit 3980c03f6c

4
avy.el
View File

@ -1484,7 +1484,8 @@ The window scope is determined by `avy-all-windows' or
"Select two lines and move the text between them here."
(interactive)
(avy-with avy-move-region
(let* ((beg (avy--line))
(let* ((initial-window (selected-window))
(beg (avy--line))
(end (save-excursion
(goto-char (avy--line))
(forward-line)
@ -1493,6 +1494,7 @@ The window scope is determined by `avy-all-windows' or
(pad (if (bolp) "" "\n")))
(move-beginning-of-line nil)
(delete-region beg end)
(select-window initial-window)
(insert text pad))))
;;;###autoload