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 replace when replacement text matches source text multiple times #16258
Fix replace when replacement text matches source text multiple times #16258
Conversation
Thanks for making a pull request to jupyterlab! |
b454918
to
dd7134e
Compare
With Firefox and Chrome, I see the expected behavior when I replace the search text (e.g., (Update: After a rebase, the 2x and 3x cases are not working again :( ) |
The most recent commits fix the 0-match, 1-match, 2-match, and 3-match cases on my desktop. |
3c7404e
to
1e87e1c
Compare
Still seeing unit test failures; I might have to test again after a rebase. |
All tests related to search and replace are now passing; this PR is now ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good locally, thank you @JasonWeill!
References
Fixes #16242.
Code changes
Advances to the next match when the replacement text matches the source text at least twice.
(This is a draft PR with tests created first.)
User-facing changes
After replacing a search term (e.g.,
foo
) with replacement text that contains the search term multiple times (foofoofoo
) the highlight advances to the next match after the replacement text, including if the next match is in a later cell.Backwards-incompatible changes
None.