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

fix: F3 failed to locate the correct set of matches if file was edited after doing a search. #1867

Merged
merged 4 commits into from
Sep 15, 2024

Conversation

paxcut
Copy link
Contributor

@paxcut paxcut commented Aug 24, 2024

Problem description

The bug can be reproduced as follows:

  1. Using Ctrl-F do a search for a term that occurs several times in the file. and press F3 to visit them.
  2. Go back to the fop of the file and insert 3 blank lines.
  3. Pressing F3 once or many times will not find the term entered above.

Implementation description

The reason for this bug is that the positions of the matches are not being reset when changes can potentially move them.
The fix consists on resetting the search locations when changing the contents of the file and redoing the search after the changes are made. The bug was specially problematic when doing replace because the replacement position would be identified as a match. This PR fixes replace as well.

paxcut and others added 4 commits August 24, 2024 16:48
…d after doing a search.

The bug can be reproduced as follows:
1) Using ctrl-F do a search for a term that occurs several times in the file. and press f3 to visit them.
2) go back to the fop of the file and insert 3 blank lines.
3) pressing f3 once or many times will not find the term entered above.

The reason for this bug is that the positions of the matches are not being reset when changes can potentially move them. The fix consists on resetting the search locations when changing the contents of the file and redoing the search after the changes are made. The bug was specially problematic when doing replace because the replacement position would be identified as a match. This PR fixes replace as well.
@WerWolv WerWolv merged commit 96a588b into WerWolv:master Sep 15, 2024
1 of 15 checks passed
@paxcut paxcut deleted the resetFindReplacePatternEditor branch September 17, 2024 22:36
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

Successfully merging this pull request may close these issues.

2 participants