Skip to content

In Find, "only whole words" also finds postfixes #1857

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
gugray opened this issue May 8, 2021 · 3 comments · Fixed by #1915
Closed

In Find, "only whole words" also finds postfixes #1857

gugray opened this issue May 8, 2021 · 3 comments · Fixed by #1915
Labels
Good First Issue A beginner-friendly issue, great for first-time contributors Help Wanted Would love additional input or contributions! Priority:High Should be addressed soon but not critical

Comments

@gugray
Copy link
Contributor

gugray commented May 8, 2021

Nature of issue?

  • Found a bug

Details about the bug:

  • Web browser and version: 88.0.1 (64-bit)
  • Operating System: Windows 10

Steps:

  • Have a sketch open for editing. The sketch should have strings that appear as whole tokens, and as part of other tokens, e.g.: abc, ab, a, ba, bac, Santa
  • Press Ctrl+F to bring up the Find window. Make sure all the options are unchecked: not a regex, not case sensitive, not "only whole words".
  • Enter a single lower-case 'a' and press Enter to search.
    Result: All occurences of "a" are highlighted, and pressing Enter or the "next" arrow cycles through them. Great.
  • Check "only whole words", return to the text field, and press Enter to search again.
    Actual Result: Highlighted are all occurrences where "a" is the last character of a token, including but not limited to where "a" is the whole word. Pressing Enter or the "next" arrow cycles through all of these.
    Expected Result: only those occurrences are found where the input is the whole word, not where its the postfix of a token.

The example uses single-letter "a", but it works with multiple-letter search terms too. The issue doesn't seem to be affected by what you're searching for.

Attaching a screen grab of the issue.

find-whole-words.mp4
@welcome
Copy link

welcome bot commented May 8, 2021

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

@catarak
Copy link
Member

catarak commented Jun 11, 2021

Thanks for reporting! The Find/Replace code is located in the file codemirror-search.js, which is an altered version the default find/replace build into CodeMirror (see CodeMirror version). That's the place to start to fix this issue!

@catarak catarak added Good First Issue A beginner-friendly issue, great for first-time contributors Help Wanted Would love additional input or contributions! Priority:High Should be addressed soon but not critical type:bug labels Jun 11, 2021
@divyanx
Copy link
Contributor

divyanx commented Aug 18, 2021

It seems that the bug is unresolved.
Can I work on this?
It will be my first issue.

catarak added a commit that referenced this issue Nov 3, 2021
Fixed #1857 - In Find, "only whole words" also finds postfixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue A beginner-friendly issue, great for first-time contributors Help Wanted Would love additional input or contributions! Priority:High Should be addressed soon but not critical
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants