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