Skip to content

Commit

Permalink
Merge pull request #37 from Foldex/master
Browse files Browse the repository at this point in the history
Fix kill before paste in evil-multiedit--paste-replace
  • Loading branch information
Henrik Lissner authored Feb 29, 2020
2 parents c3d43b1 + a83ca86 commit 9f271e0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions evil-multiedit.el
Original file line number Diff line number Diff line change
Expand Up @@ -570,19 +570,20 @@ state."
(defun evil-multiedit--paste-replace (count)
"Replace the selection with the yanked text."
(interactive "P")
(evil-multiedit--delete-occurrences)
(evil-multiedit--delete-occurrences t)
(evil-paste-before count))

(defun evil-multiedit--delete-occurrences ()
"Delete occurrences."
(defun evil-multiedit--delete-occurrences (&optional dont-kill)
"Delete occurrences. If DONT-KILL, don't add occurence to kill ring."
(interactive "*")
(iedit-barf-if-buffering)
(when iedit-occurrences-overlays
(save-excursion
(kill-new
(buffer-substring-no-properties
(overlay-start (car iedit-occurrences-overlays))
(overlay-end (car iedit-occurrences-overlays))))
(if (not dont-kill)
(kill-new
(buffer-substring-no-properties
(overlay-start (car iedit-occurrences-overlays))
(overlay-end (car iedit-occurrences-overlays)))))
(dolist (occurrence iedit-occurrences-overlays)
(delete-region (overlay-start occurrence) (overlay-end occurrence))))))

Expand Down

0 comments on commit 9f271e0

Please sign in to comment.