Repository navigation
Keep Unicode overlap excerpts centered on the actual match - #5736
Merged
Merged
Conversation
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.
Unicode lowercase can expand one source character into two. The overlap search used an index in the expanded text to slice the original body, so a reported hit could have an excerpt that omitted the hit entirely. Map that index back to the original text before taking the excerpt. Matching and ranking semantics stay unchanged.
Validation: reproduced the omitted-match excerpt on main. All 100 overlap-consumer tests pass on Python 3.12; the 5 new regressions also pass under
-O. Cases cover long expanding prefixes, a match within an expanded character, numeric card references, multiple terms, ASCII output and title-only matches.git diff --checkpasses.Fresh main/priorities and live PR/Discussion overlap checked. Other open fixes to this tool are this sequence’s separate cache, pagination and path-reading scopes; this PR changes only excerpt positioning. Hosted CI is pending.
Base:
df0137efd35e11b4445734bf612bdd4c7ebc330c. Verified head:63f441c3a98e994dd99e1f1ca31199f3ef032df1.Prepared for aliromman with OpenAI Codex assistance. Existing tool and predecessor credits remain in place. No selected-frontier change.