summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Duncan <hugo@hugoduncan.org>2014-08-03 10:57:22 -0400
committerHugo Duncan <hugo@hugoduncan.org>2014-08-03 14:13:42 -0400
commitd9bc05d03060e8b63127a29b8f94043840b0091a (patch)
treea0427f227b1b4e3c3fad25fdb713d10671f77dbd
parent2c281dd5116c4eb1f7097d76cca8775c1dd53fbc (diff)
Don't make info request for empty symbol
When the symbol is an empty string, don't request info on it.
-rw-r--r--cider-client.el2
-rw-r--r--test/cider-tests.el3
2 files changed, 3 insertions, 2 deletions
diff --git a/cider-client.el b/cider-client.el
index cf74efae..d8176311 100644
--- a/cider-client.el
+++ b/cider-client.el
@@ -203,7 +203,7 @@ contain a `candidates' key, it is returned as is."
When multiple matching vars are returned you'll be prompted to select one,
unless ALL is truthy."
- (when var
+ (when (and var (not (string= var "")))
(let ((val (plist-get (nrepl-send-request-sync
(list "op" "info"
"session" (nrepl-current-session)
diff --git a/test/cider-tests.el b/test/cider-tests.el
index 4461e0b7..3d2db674 100644
--- a/test/cider-tests.el
+++ b/test/cider-tests.el
@@ -83,7 +83,8 @@
:done t))
(nrepl-current-session () nil)
(cider-current-ns () "user"))
- (should (equal (cadr (assoc "doc" (cider-var-info "str"))) "stub" ))))
+ (should (equal (cadr (assoc "doc" (cider-var-info "str"))) "stub" ))
+ (should (not (cider-var-info "")))))
(ert-deftest test-cider-get-var-attr ()
(let ((var-info '(("doc" "var doc") ("arglists" "var arglists"))))