File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -331,9 +331,11 @@ Return the created process."
331
331
; ; If emacs version >= 26.2, we can use replace-buffer-contents to
332
332
; ; preserve location and markers in buffer, otherwise we can try to
333
333
; ; save locations as best we can, though we still lose markers.
334
- (if (version<= " 26.2" emacs-version)
335
- (rust--format-buffer-using-replace-buffer-contents)
336
- (rust--format-buffer-saving-position-manually)))
334
+ (save-excursion
335
+ (save-window-excursion
336
+ (if (version<= " 26.2" emacs-version)
337
+ (rust--format-buffer-using-replace-buffer-contents)
338
+ (rust--format-buffer-saving-position-manually)))))
337
339
338
340
(defun rust-enable-format-on-save ()
339
341
" Enable formatting using rustfmt when saving buffer."
You can’t perform that action at this time.
0 commit comments