Skip to content

Commit

Permalink
gptel-rewrite: Make text replacement preserve overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
daedsidog committed Dec 20, 2024
1 parent 0ce1628 commit 14f77bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gptel-rewrite.el
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ BUF is the buffer to modify, defaults to the overlay buffer."
do (overlay-put ov 'before-string nil)
(with-current-buffer buf
(goto-char ov-beg)
(delete-region ov-beg ov-end)
(insert response))))
(insert response)
(delete-region (point) (+ (point) (- ov-end ov-beg))))))
(message "Replaced region(s) with LLM output in buffer: %s."
(buffer-name ov-buf))))

Expand Down

0 comments on commit 14f77bf

Please sign in to comment.