mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 13:33:03 +00:00
parent
54074c764d
commit
fa6d1e1242
17
avy.el
17
avy.el
@ -1143,17 +1143,22 @@ ARG lines can be used."
|
||||
(user-error "Unexpected `avy-line-insert-style'"))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun avy-copy-region ()
|
||||
"Select two lines and copy the text between them here."
|
||||
(interactive)
|
||||
(defun avy-copy-region (arg)
|
||||
"Select two lines and copy the text between them to point.
|
||||
|
||||
The window scope is determined by `avy-all-windows' or
|
||||
`avy-all-windows-alt' when ARG is non-nil."
|
||||
(interactive "P")
|
||||
(let ((initial-window (selected-window)))
|
||||
(avy-with avy-copy-region
|
||||
(let* ((beg (avy--line))
|
||||
(end (avy--line))
|
||||
(let* ((beg (avy--line arg))
|
||||
(end (avy--line arg))
|
||||
(str (buffer-substring-no-properties
|
||||
beg
|
||||
(save-excursion
|
||||
(goto-char end)
|
||||
(line-end-position)))))
|
||||
(select-window initial-window)
|
||||
(cond ((eq avy-line-insert-style 'above)
|
||||
(beginning-of-line)
|
||||
(save-excursion
|
||||
@ -1164,7 +1169,7 @@ ARG lines can be used."
|
||||
(save-excursion
|
||||
(insert str)))
|
||||
(t
|
||||
(user-error "Unexpected `avy-line-insert-style'"))))))
|
||||
(user-error "Unexpected `avy-line-insert-style'")))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun avy-setup-default ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user