next.js
7006eb02 - Optimize highlight.rs to only produce markers for visible lines

Commit
48 days ago
Optimize highlight.rs to only produce markers for visible lines Reduce memory usage by accepting a line range parameter in extract_highlights() and only producing style markers for lines that will be displayed in the code frame. This is especially beneficial for large files where only ~10-20 lines are visible. Changes: - Add Range<usize> parameter to extract_highlights() for 0-indexed line ranges - Add byte-range filtering to skip marker production outside visible range - Still lex entire file to maintain correct parsing state - Update frame.rs to pass first_line..last_line range - Add tests for line range filtering and marker count reduction 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Author
Committer
Parents
Loading