Function: avy-copy-line
avy-copy-line is an interactive and natively compiled function defined
in avy.el.
Signature
(avy-copy-line ARG)
Documentation
Copy a selected line above the current line.
ARG lines can be used.
Key Bindings
This command is not in any keymaps.
Source Code
;; Defined in /nix/store/015952xhg9b72ira1qyjvb30bn11jiv3-emacs-packages-deps/share/emacs/site-lisp/elpa/avy-20241101.1357/avy.el
;;;###autoload
(defun avy-copy-line (arg)
"Copy a selected line above the current line.
ARG lines can be used."
(interactive "p")
(let ((initial-window (selected-window)))
(avy-with avy-copy-line
(let* ((start (avy--line))
(str (buffer-substring-no-properties
start
(save-excursion
(goto-char start)
(move-end-of-line arg)
(point)))))
(select-window initial-window)
(cond ((eq avy-line-insert-style 'above)
(beginning-of-line)
(save-excursion
(insert str "\n")))
((eq avy-line-insert-style 'below)
(end-of-line)
(insert "\n" str)
(beginning-of-line))
(t
(user-error "Unexpected `avy-line-insert-style'")))))))