-
-
Notifications
You must be signed in to change notification settings - Fork 338
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-update-candidates
: support alists
#2715
Comments
Elements of CANDS are eventually passed trough to `ivy--format-minibuffer-line', which errors out as it expects a string, not conses. Modify it to accept conses, rendering their `car'. Fixes abo-abo#2715.
I'm not really familiar with these murky depths of Ivy, so I could be very wrong, but I was under the impression that |
Either solutions sound non-satisfying: we need |
Here is an example to reproduce: (ivy-read
"Test: "
(lambda (&rest _)
(run-with-idle-timer
0.2 nil (lambda () (ivy-update-candidates '(("1" . 0) ("2" . 5)))))
nil)) |
It works with my PR, but not without it. |
Then I'm afraid we'll have to wait for @abo-abo to pitch in, since I have no idea what the intended design and use of the undocumented |
ivy-update-candidates
currently errors if an alist is passed to it. This breaks mylsp-ivy
refactor.The problem lies in
ivy--format-minibuffer-line
, which callscopy-sequence
on its argument, which is an element of the CANDS list passed toivy-update-candidates
.copy-sequence
expects a string, not a cons, so errors out. The fix is trivial, a single line at the start ofivy--format-minibuffer-line
that checks if the element is a cons or a string:However, I am unsure whether this is the right way to go about this, because it is a bit ad-hoc:
ivy-update-candidates
would not behave consistently withivy-read
, as its CANDS field cannot be a hash-table, .... Also, it has no docstring, meaning it is unclear what format its CANDS field should have. I'd like to not have to resort to text-properties for this.I have provided a PR with my proposal. Copyright shouldn't be an issue, as a single line (my first contribution to this project) is < 15 lines.
The text was updated successfully, but these errors were encountered: