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 replace behavior of FindReplaceLogic/Dialog for RegEx search #1540 #1541

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

HeikoKlare
Copy link
Contributor

@HeikoKlare HeikoKlare commented Jan 22, 2024

The replace functionality of the FindAndReplaceLogic checks whether the current selection fits to the current search string and otherwise performs a find operation first. To this end, it compares the text selection with the search string, even if regex search is used. In regex search mode, this check will usually fail and a find operation is performed even though a correct string is already selected. This results in the replacement of the next instead of the current match.

With this change, the check for whether the currently selected string fits to the search string properly considers regex search mode. In consequence, all replace operations consider the current selection for replacement if fitting. It also adds according regression tests.

Fixes #1540

Copy link
Contributor

github-actions bot commented Jan 22, 2024

Test Results

   918 files  ±0     918 suites  ±0   47m 48s ⏱️ + 1m 17s
 7 439 tests ±0   7 286 ✅  - 1  152 💤 ±0  1 ❌ +1 
23 466 runs  ±0  22 957 ✅  - 1  508 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 3ebee11. ± Comparison against base commit 4b0353a.

♻️ This comment has been updated with latest results.

@HeikoKlare HeikoKlare changed the title Fix Replace/Find behavior for RegEx search #1540 Fix replace behavior of FindReplaceLogic/Dialog for RegEx search #1540 Jan 23, 2024
@HeikoKlare HeikoKlare marked this pull request as ready for review January 23, 2024 08:18
@HeikoKlare HeikoKlare force-pushed the issue-1540 branch 6 times, most recently from 127756b to 6a55549 Compare January 29, 2024 13:03
…pse-platform#1540

The replace functionality of the FindAndReplaceLogic checks whether the
current selection fits to the current search string and otherwise
performs a find operation first. To this end, it compares the text
selection with the search string, even if regex search is used. In regex
search mode, this check will usually fail and a find operation is
performed even though a correct string is already selected. This results
in the replacement of the next instead of the current match.

With this change, the check for whether the currently selected string
fits to the search string properly considers regex search mode. In
consequence, all replace operations consider the current selection for
replacement if fitting. It also adds according regression tests.

Fixes eclipse-platform#1540
@HeikoKlare
Copy link
Contributor Author

Failing test is documented as random failure: #751

@HeikoKlare HeikoKlare merged commit 33cdc2a into eclipse-platform:master Jan 29, 2024
14 of 16 checks passed
@HeikoKlare HeikoKlare deleted the issue-1540 branch January 29, 2024 14:47
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.

Replace/Find button skips every second occurrence
1 participant