Skip to content

Prepare line fragments before tokenizer boundary queries - #441

Merged
simonbs merged 1 commit into
mainfrom
codex/fix-tokenizer-layout
Oct 25, 2026
Merged

simonbs merged 1 commit into
mainfrom
codex/fix-tokenizer-layout

Conversation

@simonbs

@simonbs simonbs commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Replacing text can synchronously trigger UIKit line-boundary queries from selectionDidChange before the rebuilt line has been laid out. Prepare fragments through the queried location before looking them up.

Fixes #415.

Existing PR #427 targets the same underlying problem. This alternative prepares unconditionally, covering both not-yet-typeset lines and previously finished typesetters invalidated by edits, and adds a regression for the reported synchronous callback. The broader movement changes in #427 are not required for that stack trace.

Validation: all 26 tokenizer tests passed on iOS 27.2; SwiftLint passed changed files.

Copilot AI balanced review requested due to automatic review settings October 25, 2026 02:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@simonbs
simonbs merged commit 70947ae into main Oct 25, 2026
8 checks passed
@simonbs
simonbs deleted the codex/fix-tokenizer-layout branch October 25, 2026 02:38
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.

Reproducible "Fatal error: 2 is out of bounds. Valid range is 0 - 0" with specific content

2 participants