Skip to content

Commit

Permalink
[Fix #2045] *cider-scratch* is no longer an ancillary buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
vspinu authored and bbatsov committed Aug 29, 2017
1 parent cb87da4 commit 595e8a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Changes

* [#2045](https://github.com/clojure-emacs/cider/issues/2045) `*cider-scratch*` buffers are no longer automatically killed on connection quit.

### Bugs Fixed

* [#2004](https://github.com/clojure-emacs/cider/issues/2004), [#2039](https://github.com/clojure-emacs/cider/issues/2039), [cider-nrepl#420](https://github.com/clojure-emacs/cider-nrepl/issues/420): Fix namespace issues in instrumentation and debugging commands.
Expand Down
5 changes: 4 additions & 1 deletion cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -1775,15 +1775,18 @@ START and END represent the region's boundaries."
(when conn
(cider--close-connection-buffer conn)))

(defvar cider-scratch-buffer-name)
(defun cider-quit (&optional quit-all)
"Quit the currently active CIDER connection.
With a prefix argument QUIT-ALL the command will kill all connections
and all ancillary CIDER buffers."
(interactive "P")
(cider-ensure-connected)
(if (and quit-all (y-or-n-p "Are you sure you want to quit all CIDER connections? "))
(progn
(when-let ((scratch (get-buffer cider-scratch-buffer-name)))
(when (y-or-n-p (format "Kill %s? buffer" cider-scratch-buffer-name))
(kill-buffer cider-scratch-buffer-name)))
(dolist (connection cider-connections)
(cider--quit-connection connection))
(message "All active nREPL connections were closed"))
Expand Down
1 change: 0 additions & 1 deletion cider-scratch.el
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
map))

(defconst cider-scratch-buffer-name "*cider-scratch*")
(add-to-list 'cider-ancillary-buffers cider-scratch-buffer-name)

;;;###autoload
(defun cider-scratch ()
Expand Down

0 comments on commit 595e8a7

Please sign in to comment.