diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2014-08-03 21:38:13 +0300 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2014-08-03 21:38:13 +0300 |
commit | 74d47ef5a5787a736464905577c1fe791e49fdf6 (patch) | |
tree | a0427f227b1b4e3c3fad25fdb713d10671f77dbd | |
parent | 2c281dd5116c4eb1f7097d76cca8775c1dd53fbc (diff) | |
parent | d9bc05d03060e8b63127a29b8f94043840b0091a (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.el | 2 | ||||
-rw-r--r-- | test/cider-tests.el | 3 |
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")))) |