Skip to content

Commit 1398c0b

Browse files
authored
Merge pull request #479 from ntBre/master
check for rustfmt window before deleting it, fixes the fix to #475
2 parents 384051e + 4f7581d commit 1398c0b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rust-rustfmt.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@
6969
(with-current-buffer buf
7070
(replace-buffer-contents rust-rustfmt-buffername))
7171
(copy-to-buffer buf (point-min) (point-max))))
72-
(kill-buffer-and-window))
72+
(let ((win (get-buffer-window rust-rustfmt-buffername)))
73+
(if win
74+
(quit-window t win)
75+
(kill-buffer rust-rustfmt-buffername))))
7376
((= ret 3)
7477
(if (not (string= (buffer-string)
7578
(with-current-buffer buf (buffer-string))))

0 commit comments

Comments
 (0)