diff --git a/crux.el b/crux.el index d7654cf..a6ca1fa 100644 --- a/crux.el +++ b/crux.el @@ -384,7 +384,8 @@ there's a region, all lines that region covers will be duplicated." (region (buffer-substring-no-properties beg end))) (dotimes (_i arg) (goto-char end) - (newline) + (unless (use-region-p) + (newline)) (insert region) (setq end (point))) (goto-char (+ origin (* (length region) arg) arg)))) @@ -402,7 +403,8 @@ there's a region, all lines that region covers will be duplicated." (setq end (line-end-position)) (dotimes (_ arg) (goto-char end) - (newline) + (unless (use-region-p) + (newline)) (insert region) (setq end (point))) (goto-char (+ origin (* (length region) arg) arg))))