summaryrefslogtreecommitdiff
path: root/rust-rustfmt.el
diff options
context:
space:
mode:
Diffstat (limited to 'rust-rustfmt.el')
-rw-r--r--rust-rustfmt.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/rust-rustfmt.el b/rust-rustfmt.el
index ff5ba25..de618cb 100644
--- a/rust-rustfmt.el
+++ b/rust-rustfmt.el
@@ -69,7 +69,10 @@
(with-current-buffer buf
(replace-buffer-contents rust-rustfmt-buffername))
(copy-to-buffer buf (point-min) (point-max))))
- (kill-buffer-and-window))
+ (let ((win (get-buffer-window rust-rustfmt-buffername)))
+ (if win
+ (quit-window t win)
+ (kill-buffer rust-rustfmt-buffername))))
((= ret 3)
(if (not (string= (buffer-string)
(with-current-buffer buf (buffer-string))))