Skip to content

Commit 4f7581d

Browse files
committed
check for rustfmt window before deleting it, fixes the fix to #475
adapted from https://github.com/dominikh/go-mode.el/blob/08aa90d52f0e7d2ad02f961b554e13329672d7cb/go-mode.el#L1986
1 parent 384051e commit 4f7581d

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)