mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 13:33:03 +00:00
parent
bbf1e7339e
commit
e92cb37457
16
avy.el
16
avy.el
@ -2176,6 +2176,22 @@ The window scope is determined by `avy-all-windows' (ARG negates it)."
|
|||||||
(error
|
(error
|
||||||
(set-mark-command 4)))))
|
(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)))))))
|
||||||
|
|
||||||
;; ** Org-mode
|
;; ** Org-mode
|
||||||
(defvar org-reverse-note-order)
|
(defvar org-reverse-note-order)
|
||||||
(declare-function org-refile "org")
|
(declare-function org-refile "org")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user