summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2014-08-03 21:38:13 +0300
committerBozhidar Batsov <bozhidar@batsov.com>2014-08-03 21:38:13 +0300
commit74d47ef5a5787a736464905577c1fe791e49fdf6 (patch)
treea0427f227b1b4e3c3fad25fdb713d10671f77dbd
parent2c281dd5116c4eb1f7097d76cca8775c1dd53fbc (diff)
parentd9bc05d03060e8b63127a29b8f94043840b0091a (diff)
Merge pull request #697 from hugoduncan/feature/no-info-on-empty-string
Don't make info request for empty symbol
-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"))))