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

[REVIEW ONLY] Add "Find Whole Word" Functionality #12873

Open
core-ai-bot opened this issue Aug 31, 2021 · 14 comments
Open

[REVIEW ONLY] Add "Find Whole Word" Functionality #12873

core-ai-bot opened this issue Aug 31, 2021 · 14 comments

Comments

@core-ai-bot
Copy link
Member

Issue by MarcelGerber
Saturday Oct 11, 2014 at 08:52 GMT
Originally opened as adobe/brackets#9526


This is still a somewhat ugly and hacky implementation, but it works at least ;)

Successor of #8310, using a dropdown for RegExp and Whole Word toggle.


MarcelGerber included the following code: https://github.com/adobe/brackets/pull/9526/commits

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Wednesday Aug 26, 2015 at 18:14 GMT


I didn't realize the existence of this PR so I implemented the same feature in adobe/brackets#11624
@MarcelGerber can this PR be rebased? (So I'll close mine).
Otherwise I'll see if your image can fit mine PR.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Friday Aug 28, 2015 at 18:39 GMT


@ficristo I just pushed the update plus a few changes.

@core-ai-bot
Copy link
Member Author

Comment by abose
Tuesday Sep 08, 2015 at 07:29 GMT


@MarcelGerber Could you comment a screenshot here?

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Saturday Sep 12, 2015 at 18:58 GMT


image

@core-ai-bot
Copy link
Member Author

Comment by Denisov21
Saturday Oct 10, 2015 at 15:56 GMT


👍 I hope that this feature will be added soon!

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Saturday Jan 30, 2016 at 09:21 GMT


I think is time to review and merge this: it is a basic feature that other code editore have (Notepad++, Sublime, Atom).
I find the dropdown unhelpful: it only hide things.
Plus for what I've seen on Sublime you can use the regex search both with whole words and match case so the reason to have it aren't really strong to me.
Finally in the almost two years that are passed from the first version no other options were added to the findbar...
/cc@abose@swmitra

@core-ai-bot
Copy link
Member Author

Comment by abose
Monday Feb 01, 2016 at 03:24 GMT


I too find the drop down hiding the search option. we could add match whole case as one more button in the findbar as all three could work with each other.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Saturday Apr 30, 2016 at 20:31 GMT


This PR is up-to-date again, with the toggle moved into the find bar.

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Sunday May 01, 2016 at 15:13 GMT


@MarcelGerber could you add some tests?

@core-ai-bot
Copy link
Member Author

Comment by swmitra
Wednesday Feb 15, 2017 at 06:51 GMT


@MarcelGerber Can you please resolve the conflicts? I can test and merge this PR then...

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Sunday Jun 18, 2017 at 08:31 GMT


Unfortunately, I've now noticed that our RegExp-based search implementation is not well fitted for whole-word detection.
In JavaScript, \b only detects ASCII chars as "non-word-boundary". I don't think that's good enough and gets us false positives like this:
image

I tried fixing that with the more advanced XRegExp and it worked for the word end using lookaheads, but as JS doesn't support lookbehinds, we cannot do the same for the word start.

I don't know what to do about that now. Refactoring the find system seems overkill, and is not trivial either.

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Sunday Jun 18, 2017 at 09:13 GMT


I tryed VSCode and it seems to have the same behaviour.

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Sunday Jun 18, 2017 at 09:23 GMT


Also to replace this missing feature I use a regexp search with \b, which has the same problem (of course).

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Tuesday Jun 20, 2017 at 20:28 GMT


Interesting.
The editor I tried was Notepad++ and it seems like it actually has a Unicode-proof implementation.
From looking at the source code only, I gathered that Atom doesn't have a "Find whole word" functionality at all.

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

1 participant