Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ivy completing read compatibility for non-string defaults #1810

Closed
wants to merge 2 commits into from

Conversation

@nxtr
Copy link
Contributor

commented Nov 19, 2018

For non-string defaults, fix compat with `completing-read' to return the first element of default, if it is a list; "", if default is nil; or default
Also, fixes where previously a non-string default (symbol) cleared the collection

Fixes #1526

nxtr added 2 commits Nov 8, 2018
ivy.el (ivy--reset-state): Add only string default to collection
Preparation to allow non-string default values:

* Add only default string values to collection for completion
* Fix where previously a non-string default (symbol) cleared the collection
ivy.el (ivy-completing-read): Add compatibility for non-string defaults
* Fix compat with `completing-read' to return the first element of
  default, if it is a list; "", if default is nil; or default
* ivy-test.el: Add relevant positive tests

Fixes  #1526
@abo-abo

This comment has been minimized.

Copy link
Owner

commented Nov 19, 2018

Thanks. Merged with minor changes. I wanted to keep the def in the argument list, since that's the same name as in completing-read. Please review.

@nxtr

This comment has been minimized.

Copy link
Contributor Author

commented Nov 19, 2018

Makes sense, LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.