mirror of
https://github.com/zed-industries/zed.git
synced 2026-08-24 16:34:46 +00:00
BufferSnapshot::chunks re-ran the tree-sitter highlight query over the requested range on every call, so scrolling and cursor movement paid the full query cost per frame. Highlight captures are now computed once per 50-row chunk (the same RowChunks that back bracket colorization), flattened into runs of capture-id stacks, and kept in a cost-budgeted per-buffer LRU (10MB). Runs resolve through the current HighlightMap at read time, so theme changes need no invalidation; edits and reparses drop the cache through the existing TreeSitterData swap. Chunks spanning more than 64KB bypass the cache and fall back to direct querying, so files with giant lines behave as before. New editor_render_highlighted and editor_render_highlighted_minimap benches move the cursor through a generated 10K-line Rust file with real highlighting, with and without the minimap; ZED_DISABLE_HIGHLIGHT_CACHE=1 routes rendering through the pre-existing direct-query path for comparison. |
||
|---|---|---|
| .. | ||
| benches | ||
| src | ||
| build.rs | ||
| Cargo.toml | ||
| LICENSE-GPL | ||