-
Notifications
You must be signed in to change notification settings - Fork 197
'whole word' search fails when the string starts with $ (dollar sign) #576
Comments
I'm going to assume that this was fixed by #583. |
This is still an issue because |
I confirm it is still an issue even after I declared $ as a word character (for JS, Java, PHP, etc.) via the nonWordCharacters setting:
for example. |
I don't think this this should be connected or related to nonWordCharacters or any other other settings |
@a7madgamal Why? The concept of word IS dependent on language. In CSS, foo-bar is a "word" (identifier), and it is not in JS. $ is allowed in identifier names in some languages, not in others. Etc. |
@PhiLhoSoft mmm never thought of it like that if I replace $test in the whole project I don't want to think about every file grammer, I just want to see ALL the results where this TEXT is found and followed only by a white character, end of line or a new line. processing this will probably make the search slower, introduce more issues in the future for current and new grammers the find and replace in project is crucial to all developers, failing to detect some or all results for find and replace can be disastrous and very hard to fix specially if the tool I probably use fails me. I was really annoyed when i found this issue by luck seeing the exact string I'm looking for in front of me but not detected by atom, you don't want that :D |
@a7madgamal I am not sure what you are talking about. It can be done with regular expressions, but that's more typing, and potentially escaping. |
@PhiLhoSoft I don't think "whole word" is tied to variables only. |
The issue is still there. However, I found a different workaround by using regular expression search. So if you are searching for |
I would agree that this is still an issue. For the purposes of searching, any consecutive set characters should be considered a word, determined only be surrounding whitespace. |
I want report this issue too. Thats very frustrating for PHP/JavaScript developers. |
Atom 1.0.19 on Mac
$example = x;
when I search for $example and turn on 'whole word' I get 0 results and when I turn it off works normally.
As a node developer and Atom lover, I took a quick look (ok not very quick :D) and found the exact problem. for some reason, regex.exec fail to work when \b$ are next to each other.
this is from the next function inside text-buffer/lib/match-iterator.js
The text was updated successfully, but these errors were encountered: