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:
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.
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.
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".