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

invalid-regexp error by counsel-yank-pop #2002

Closed
iquiw opened this issue Apr 5, 2019 · 2 comments
Closed

invalid-regexp error by counsel-yank-pop #2002

iquiw opened this issue Apr 5, 2019 · 2 comments

Comments

@iquiw
Copy link
Contributor

@iquiw iquiw commented Apr 5, 2019

Starting from make plain,

  1. Eval the following.

    (kill-new "[")
    (kill-new "a")
    (counsel-yank-pop)
  2. Type any 2 chars (e.g. xx)

Error is thrown from here.

In addition to that, there is another invalid regexp error by the following.
I am not sure whether this one is bug or not.

(ivy-read "test: " '("a") :preselect "[")
basil-conto added a commit to basil-conto/swiper that referenced this issue Apr 5, 2019
* doc/ivy.org (Optional arguments for ivy-read):
* ivy.el (ivy-read): Extend :preselect documentation.
(ivy--preselect-index, ivy--recompute-index): Do not use preselect
as a regexp if invalid.
(ivy--legal-regex-p): Rename to...
(ivy--regex-p): ...this.  Return nil regardless of the type of
error.
(ivy--regex-or-literal): Use it.

Fixes abo-abo#2002
@basil-conto
Copy link
Collaborator

@basil-conto basil-conto commented Apr 5, 2019

I am not sure whether this one is bug or not.

It is definitely a bug, since Ivy is trying to use an arbitrary string as a regexp. #2004 should fix this and also document the behaviour of :preselect properly.

@abo-abo abo-abo closed this in #2004 Apr 5, 2019
@iquiw
Copy link
Contributor Author

@iquiw iquiw commented Apr 6, 2019

@basil-conto Thanks!

astoff added a commit to astoff/swiper that referenced this issue Jan 1, 2021
* doc/ivy.org (Optional arguments for ivy-read):
* ivy.el (ivy-read): Extend :preselect documentation.
(ivy--preselect-index, ivy--recompute-index): Do not use preselect
as a regexp if invalid.
(ivy--legal-regex-p): Rename to...
(ivy--regex-p): ...this.  Return nil regardless of the type of
error.
(ivy--regex-or-literal): Use it.

Fixes abo-abo#2002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants