File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 5252; ; (move-dup-mode)
5353
5454; ;; Code:
55+
56+ (defgroup move-dup nil
57+ " Move or duplicate text."
58+ :group 'editing
59+ :prefix " move-dup" )
60+
61+ (defcustom move-dup-undo-auto-amalgamate t
62+ " Whether a series of move-dup command should only require one undo to undo all."
63+ :type 'boolean
64+ :group 'move-dup )
65+
66+ (defun md-merge-undo-boundaries-maybe ()
67+ (when move-dup-undo-auto-amalgamate
68+ (undo-auto-amalgamate )))
69+
5570(defun md-ensure-rectangle ()
5671 " Normalizes the selection by making sure it's always a rectangle.
5772
@@ -117,6 +132,7 @@ forward N lines; otherwise backward."
117132
118133(defun md-move-line-or-region (n )
119134 " Decides whether a line or selection should be moved N lines."
135+ (md-merge-undo-boundaries-maybe)
120136 (if (use-region-p )
121137 (md-move-region n)
122138 (md-move-line n)))
@@ -163,6 +179,7 @@ line or selection."
163179 " Decides whether a line or selection should be duplicated.
164180
165181DIRECTION must be one of \" up\" or \" down\" ."
182+ (md-merge-undo-boundaries-maybe)
166183 (if (use-region-p )
167184 (md-duplicate-region direction)
168185 (md-duplicate-line direction)))
You can’t perform that action at this time.
0 commit comments