diff: Bound syntax context work

a10a38f0f4610e76ba5ee9b822472d95faebbd25
Open a diff whose visible hunks are far apart in a large TSX file: fetching
256 lines of leading context makes the tokenizer traverse an unrelated,
pathological expression and the highlight batch does not return.

Limit repository context to 64 lines so syntax state remains useful without
letting distant source block every row in the batch.

Assisted-by: Codex:gpt-5.6-sol
Alexis Sellier committed ago 1 parent ad9387a4
crates/diff/src/highlighter.rs +1 -1
20 20
    BuiltinHighlighter, ContextRequest, ContextUpdate, Decode, DiffDocument, DiffHighlighter,
21 21
    DiffSide, FileId, HighlightRequest, HighlightResult, HighlightSource, Oid,
22 22
};
23 23
24 24
/// Source context lines fetched around highlighted rows.
25 -
const HIGHLIGHT_CONTEXT_LINES: usize = 256;
25 +
const HIGHLIGHT_CONTEXT_LINES: usize = 64;
26 26
/// Bound on queued highlight and context commands.
27 27
const COMMAND_QUEUE: usize = 4;
28 28
29 29
/// A running background highlighter.
30 30
///