summaryrefslogtreecommitdiff
path: root/cider-client.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2017-12-10 16:49:01 +0200
committerBozhidar Batsov <bozhidar@batsov.com>2017-12-10 16:49:01 +0200
commit788ba581ecbe806752583b05f1a4bd0404a76bf9 (patch)
tree63f0bb7745438388f96501e3cd4b7109f9f2beaa /cider-client.el
parent49ef3c53f0ce839e9b080e16a70332b75f7462c0 (diff)
Check whether there are multiple active connections in cider-rotate-default-connection
Diffstat (limited to 'cider-client.el')
-rw-r--r--cider-client.el12
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.