Skip to content

Commit c664fb1

Browse files
authored
Merge pull request #23 from jscheid/18-preserve-kill-ring
Apply patch without disturbing kill ring
2 parents 6cc79cc + 0147a79 commit c664fb1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

prettier-js.el

+3-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ a `before-save-hook'."
122122
(with-current-buffer target-buffer
123123
(prettier-js--goto-line (- from line-offset))
124124
(setq line-offset (+ line-offset len))
125-
(kill-whole-line len)
126-
(setq kill-ring (cdr kill-ring))))
125+
(let ((beg (point)))
126+
(forward-line len)
127+
(delete-region (point) beg))))
127128
(t
128129
(error "Invalid rcs patch or internal error in prettier-js--apply-rcs-patch")))))))))
129130

0 commit comments

Comments
 (0)