branch: master
commit 47a220d521b9fb916f0d51da2df229a9ff7870b7
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
Support hash tables in ivy-read
* ivy.el (ivy--reset-state): `all-completions' also works fine for hash
tables, so start using it.
Hash tables as collections are rare. One example is "C-c C-w"
in *rcirc* (`rcirc-cmd-whois').
---
ivy.el | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/ivy.el b/ivy.el
index 6c3c789..7885a9c 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1026,10 +1026,9 @@ This is useful for recursive `ivy-read'."
((or (functionp collection)
(byte-code-function-p collection)
(vectorp collection)
- (listp (car collection)))
+ (and (consp collection) (listp (car collection)))
+ (hash-table-p collection))
(setq coll (all-completions "" collection predicate)))
- ((hash-table-p collection)
- (error "Hash table as a collection unsupported"))
(t
(setq coll collection)))
(when sort