diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a227ad89..625b8d130 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/cider-interaction.el b/cider-interaction.el index 909eb0ec9..d2d49e594 100644 --- a/cider-interaction.el +++ b/cider-interaction.el @@ -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")) diff --git a/cider-scratch.el b/cider-scratch.el index 4e500847d..1b6d12e5a 100644 --- a/cider-scratch.el +++ b/cider-scratch.el @@ -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 ()