mirror of
https://github.com/abo-abo/avy.git
synced 2026-02-04 06:42:26 +00:00
16
avy.el
16
avy.el
@@ -2176,6 +2176,22 @@ The window scope is determined by `avy-all-windows' (ARG negates it)."
|
|||||||
(select-window window)
|
(select-window window)
|
||||||
(goto-char (car res))))
|
(goto-char (car res))))
|
||||||
(error
|
(error
|
||||||
|
(set-mark-command 4)))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun avy-transpose-lines-in-region ()
|
||||||
|
"Transpose lines in the active region."
|
||||||
|
(interactive)
|
||||||
|
(when (and (use-region-p) (> (count-lines (region-beginning) (region-end)) 1))
|
||||||
|
(let ((avy-all-windows nil)
|
||||||
|
(fst-line-point (avy--line nil (region-beginning) (region-end))))
|
||||||
|
(when fst-line-point
|
||||||
|
(let ((snd-line-point (avy--line nil (region-beginning) (region-end))))
|
||||||
|
(when snd-line-point
|
||||||
|
(save-mark-and-excursion
|
||||||
|
(push-mark fst-line-point)
|
||||||
|
(goto-char snd-line-point)
|
||||||
|
(transpose-lines 0))
|
||||||
(avy-transpose-lines-in-region)))))))
|
(avy-transpose-lines-in-region)))))))
|
||||||
|
|
||||||
;; ** Org-mode
|
;; ** Org-mode
|
||||||
|
|||||||
Reference in New Issue
Block a user