Repository navigation
Merge upstream microsoft/edit (up to b7f8322) - #5
Merged
Merged
Conversation
Given today's news I don't feel like describing this.
Screen tearing: Gone. Mostly.
* Fixes microsoft#994 (Freezes when replacing at the end of a file) * Fixed look-behind matching (see "U8_SET_CP_START") * Fixed broken case-folding retries * Swallowing errors on regex timeout
Brings in upstream changes up to b7f8322: - Fix SIGWINCH race and EINTR handling (microsoft#996) - Use Synchronized Output (microsoft#997) - Fix several ICU usage bugs (microsoft#998) - Fix \w not matching UTF-8 continuation bytes (microsoft#1001) - Fix compilation with stable Rust (microsoft#1002) microsoft#998 changed `Regex::next()` to return `icu::Result<Option<Range>>`. Adapt the fork's `find_select_prev` (Shift+F3) accordingly so that it propagates ICU errors the same way `find_select_next` now does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If the backward scan in `find_select_prev` fails (e.g. ICU hits its time limit), the regex was left at the start or in the middle of the buffer while `next_search_offset` still pointed after the current hit. The next forward search then skipped its reset and continued from the stale position, selecting the wrong match. Reset the regex to `next_search_offset` before returning the error. Also add a test for replacing a hit found by a backward search. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Merges the latest
microsoft/editmaininto this fork. The merge has no textual conflicts. This brings in these upstream changes:\wnot matching UTF-8 continuation bytes (upstream PR 1001)Semantic conflict fix
Upstream PR 998 changed
Regex::next()to returnicu::Result<Option<Range<usize>>>instead ofOption<Range<usize>>. The fork's backward search (find_select_prev, added in #1 for Shift+F3) still used the old signature, so the merged tree failed to compile (E0308).The merge commit updates
find_select_prevto returnicu::Result<Option<Range<usize>>>and propagate errors with?, the same way upstream'sfind_select_nextnow does.Follow-up commits
next_search_offsetstill pointed after the current hit, so the next forward search could select the wrong match.find_select_prevnow resets the regex tonext_search_offsetbefore returning the error. This addstest_find_prev_error_keeps_forward_position(reproduces the bug; takes ~0.6 s because it waits for ICU's time limit) andtest_find_prev_then_replace.cargo fmtfix for a blank line introduced in Restore the post-edit cursor on redo #4.Testing
cargo build: no errors or warningscargo test: all tests pass, includingtest_find_prevand the new upstream replace testscargo clippy --all-targets: no warningscargo fmt --check: clean🤖 Generated with Claude Code