mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 13:33:03 +00:00
parent
54fb4d65e1
commit
a0414291f1
30
avy.el
30
avy.el
@ -1138,18 +1138,24 @@ ARG lines can be used."
|
|||||||
"Select two lines and copy the text between them here."
|
"Select two lines and copy the text between them here."
|
||||||
(interactive)
|
(interactive)
|
||||||
(avy-with avy-copy-region
|
(avy-with avy-copy-region
|
||||||
(let ((beg (avy--line))
|
(let* ((beg (avy--line))
|
||||||
(end (avy--line))
|
(end (avy--line))
|
||||||
(pad (if (bolp) "" "\n")))
|
(str (buffer-substring-no-properties
|
||||||
(move-beginning-of-line nil)
|
beg
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(insert
|
(goto-char end)
|
||||||
(buffer-substring-no-properties
|
(line-end-position)))))
|
||||||
beg
|
(cond ((eq avy-line-insert-style 'above)
|
||||||
(save-excursion
|
(beginning-of-line)
|
||||||
(goto-char end)
|
(save-excursion
|
||||||
(line-end-position)))
|
(insert str "\n")))
|
||||||
pad)))))
|
((eq avy-line-insert-style 'below)
|
||||||
|
(end-of-line)
|
||||||
|
(newline)
|
||||||
|
(save-excursion
|
||||||
|
(insert str)))
|
||||||
|
(t
|
||||||
|
(user-error "Unexpected `avy-line-insert-style'"))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun avy-setup-default ()
|
(defun avy-setup-default ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user