Skip to content

Commit

Permalink
Prevent buffer jumping around during fast strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbarclay committed May 22, 2024
1 parent f7d49c5 commit bdb2f3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions parinfer-rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,13 @@ CHANGES."
(switch-to-buffer current)
(if (eq parinfer-rust-buffer-replace-strategy
'fast)
(progn
(let ((window-start-pos (window-start)))
(delete-region (point-min)
(point-max))
(insert-buffer-substring new-buf))
(insert-buffer-substring new-buf)
(when (not (= window-start-pos
(window-start)))
(set-window-start (selected-window) window-start-pos)))
(replace-buffer-contents new-buf 1))
(kill-buffer new-buf)
(undo-amalgamate-change-group change-group)))))
Expand Down

0 comments on commit bdb2f3e

Please sign in to comment.