Skip to content

swiper-isearch-thing-at-point in swiper and swiper-isearch with char-folding returns no candidates #2177

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

Closed
gusbrs opened this issue Jul 30, 2019 · 3 comments

Comments

@gusbrs
Copy link
Contributor

gusbrs commented Jul 30, 2019

When search-default-mode is set to char-fold-to-regexp, and we make a search with either swiper or swiper-isearch and call swiper-isearch-thing-at-point (bound to "M-n") with point on a symbol, the symbol is inserted with symbol regex markers \_<...\_> (which is expected), resulting in no matches (which is not expected).

Steps to reproduce. Start emacs -Q and do a basic setup:

(package-initialize)
(ivy-mode)
(setq search-default-mode (quote char-fold-to-regexp))

Now, find your preferred library, let's say "ivy". Go to any symbol, let's say ivy-display-style and place point there. Start swiper or swiper-isearch, and call swiper-isearch-thing-at-point with "M-n". The search will be filled with \_<ivy-display-style\_>, and no candidates are available/matched, not even the symbol-at-point.

Environment: Emacs 26.2, ivy-20190726.2134, swiper-20190726.1746.

@abo-abo abo-abo closed this as completed in c307ae9 Aug 1, 2019
@abo-abo
Copy link
Owner

abo-abo commented Aug 1, 2019

Thanks, please test.

@gusbrs
Copy link
Contributor Author

gusbrs commented Aug 1, 2019

Working neatly, as usual. Thank you very much!

astoff pushed a commit to astoff/swiper that referenced this issue Jan 1, 2021
…egexp

With this setting:

    (setq search-default-mode #'char-fold-to-regexp)

and the input "\_<symbol-name\_>", prevent the symbol bounds from
being quoted by `char-fold-to-regexp'.

* ivy-test.el (swiper--re-builder): Add test.

Fixes abo-abo#2177
@jjnilton
Copy link

jjnilton commented May 12, 2022

I'm having this issue in Emacs 27.1 with swiper-20220430.2247 and ivy-20220406.1052. It seems to happen when using lsp-mode and the thing in point is something that the language server can use a "jump to".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants