Skip to content

Merge upstream microsoft/edit (up to b7f8322) - #5

Merged
ksshonda merged 8 commits into
mainfrom
merge-upstream
Nov 3, 2026
Merged

ksshonda merged 8 commits into
mainfrom
merge-upstream

Conversation

@ksshonda

@ksshonda ksshonda commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Merges the latest microsoft/edit main into this fork. The merge has no textual conflicts. This brings in these upstream changes:

  • Fix SIGWINCH race and EINTR handling (upstream PR 996)
  • Use Synchronized Output (upstream PR 997)
  • Fix several ICU usage bugs (upstream PR 998)
  • Fix \w not matching UTF-8 continuation bytes (upstream PR 1001)
  • Fix compilation with stable Rust (upstream PR 1002)

Semantic conflict fix

Upstream PR 998 changed Regex::next() to return icu::Result<Option<Range<usize>>> instead of Option<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_prev to return icu::Result<Option<Range<usize>>> and propagate errors with ?, the same way upstream's find_select_next now does.

Follow-up commits

  • Keep the regex in sync when a backward search fails: With errors now propagated, a failed backward scan (e.g. ICU's time limit) left the regex at a stale position while next_search_offset still pointed after the current hit, so the next forward search could select the wrong match. find_select_prev now resets the regex to next_search_offset before returning the error. This adds test_find_prev_error_keeps_forward_position (reproduces the bug; takes ~0.6 s because it waits for ICU's time limit) and test_find_prev_then_replace.
  • Remove a stray blank line in undo/redo: a cargo fmt fix for a blank line introduced in Restore the post-edit cursor on redo #4.

Testing

  • cargo build: no errors or warnings
  • cargo test: all tests pass, including test_find_prev and the new upstream replace tests
  • cargo clippy --all-targets: no warnings
  • cargo fmt --check: clean

🤖 Generated with Claude Code

lhecker and others added 8 commits October 26, 2026 20:51
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>
@ksshonda
ksshonda merged commit 0d6ad76 into main Nov 3, 2026
@ksshonda
ksshonda deleted the merge-upstream branch November 3, 2026 14:29
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.

3 participants