Issue #356 resolved

* search on word fails (underscore is not a word character)

arianaut
created an issue

Pressing * on a word searches for the word like so \<word\>, where \< and \> mark word boundaries. If I try it on, e.g., _method_name, Evil tries to search for \<_method_name\>, however, the search fails as the search term beginning or ending with an underscore doesn't register as a word boundary.

It seems there's inconsistencies in how evil handles underscores as word characters or not. This bug happens regardless of whether underscore has been added by the user as a word character, which I have done. That is, regardless of whether underscore is seen as a word character by emacs/evil:

* search considers underscores as a word character and uses them in the search. But the search itself doesn't consider them word characters, so search terms beginning and ending with underscores fail.

Comments (6)

  1. Frank Fischer repo owner
    • changed status to open

    Hm, yes, I've introduced that bug recently. It's caused by a patch for another bug report and somehow I expected to introduce a new bug but did not know which. My apologies for that, I'll try to fix as soon as possible.

  2. Frank Fischer repo owner

    Start word search with word at point, not symbol (fix #356)

    Word search now uses the buffer's definition of a "word" to determine the boundaries of the object at point to be searched for. This is consistent with the generated search pattern that uses word boundaries \< ... > and not symbol boundaries _< ... _> due to a recent change 6d3d4df57e81.

    This addresses #354.

    → <<cset fcadba79e183>>

  3. Frank Fischer repo owner

    Start word search with word at point, not symbol (fix #356)

    Word search now uses the buffer's definition of a "word" to determine the boundaries of the object at point to be searched for. This is consistent with the generated search pattern that uses word boundaries \< ... > and not symbol boundaries _< ... _> due to a recent change 6d3d4df57e81.

    This addresses #354.

    → <<cset fcadba79e183>>

  4. Log in to comment