Skip to content

Commit

Permalink
Fixed extra line issue when duplicating
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevgnen committed Mar 20, 2021
1 parent b2cdd27 commit 7659f3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crux.el
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,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))))
Expand All @@ -399,7 +400,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))))
Expand Down

0 comments on commit 7659f3b

Please sign in to comment.