diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2017-12-10 16:49:01 +0200 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2017-12-10 16:49:01 +0200 |
commit | 788ba581ecbe806752583b05f1a4bd0404a76bf9 (patch) | |
tree | 63f0bb7745438388f96501e3cd4b7109f9f2beaa /cider-client.el | |
parent | 49ef3c53f0ce839e9b080e16a70332b75f7462c0 (diff) |
Check whether there are multiple active connections in cider-rotate-default-connection
Diffstat (limited to 'cider-client.el')
-rw-r--r-- | cider-client.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cider-client.el b/cider-client.el index b07954eb..1e7439b6 100644 --- a/cider-client.el +++ b/cider-client.el @@ -1150,11 +1150,13 @@ default connection." "Rotate and display the default nREPL connection." (interactive) (cider-ensure-connected) - (setq cider-connections - (append (cdr cider-connections) - (list (car cider-connections)))) - (message "Default nREPL connection: %s" - (cider--connection-info (car cider-connections)))) + (if (= (length (cider-connections)) 1) + (user-error "There's just a single active nREPL connection") + (setq cider-connections + (append (cdr cider-connections) + (list (car cider-connections)))) + (message "Default nREPL connection: %s" + (cider--connection-info (car cider-connections))))) (defun cider-replicate-connection (&optional conn) "Establish a new connection based on an existing connection. |