Skip to content

Commit 0f8df59

Browse files
brandmbbatsov
authored andcommitted
Fix orphaned nrepl-messages buffer after cider-quit (#1788)
1 parent 424c6e5 commit 0f8df59

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
the ns-browser.
4747
* [#1708](https://github.com/clojure-emacs/cider/issues/1708): Fix `cider-popup-buffer-display` when another frame is used for the error buffer.
4848
* [#1733](https://github.com/clojure-emacs/cider/pull/1733): Better error handling when no boot command is found in exec-path.
49+
* Fix orphaned nrepl-messages buffer after `cider-quit'.
4950

5051
## 0.12.0 (2016-04-16)
5152

cider-client.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,21 @@ Moves CONNECTION-BUFFER to the front of variable `cider-connections'."
118118
(defun cider--close-connection-buffer (conn-buffer)
119119
"Close CONN-BUFFER, removing it from variable `cider-connections'.
120120
Also close associated REPL and server buffers."
121-
(let ((buffer (get-buffer conn-buffer)))
121+
(let ((buffer (get-buffer conn-buffer))
122+
(nrepl-messages-buffer (and nrepl-log-messages
123+
(nrepl-messages-buffer conn-buffer))))
122124
(setq cider-connections
123125
(delq buffer cider-connections))
124126
(when (buffer-live-p buffer)
125-
;; close the matching nREPL messages buffer
126-
(when nrepl-log-messages
127-
(when-let ((nrepl-messages-buffer (nrepl-messages-buffer conn-buffer)))
128-
(kill-buffer nrepl-messages-buffer)))
129127
(with-current-buffer buffer
130128
(when spinner-current (spinner-stop))
131129
(when nrepl-tunnel-buffer
132130
(cider--close-buffer nrepl-tunnel-buffer)))
133131
;; If this is the only (or last) REPL connected to its server, the
134132
;; kill-process hook will kill the server.
135-
(cider--close-buffer buffer))))
133+
(cider--close-buffer buffer)
134+
(when nrepl-messages-buffer
135+
(kill-buffer nrepl-messages-buffer)))))
136136

137137

138138
;;; Current connection logic

0 commit comments

Comments
 (0)