From c3d0b84b7961ae26d2d654e7120821cc2d83d20d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 24 Aug 2026 10:56:05 -0300 Subject: host: the core owns the event loop; every platform becomes a vtable of optional methods --- src/file_pane.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/file_pane.zig') diff --git a/src/file_pane.zig b/src/file_pane.zig index fd0ab2b7..42e5dba9 100644 --- a/src/file_pane.zig +++ b/src/file_pane.zig @@ -545,7 +545,10 @@ pub fn refreshHighlights(p: *Pardes) void { const slack: usize = if (f.highlights.len == 0) 0 else pane.rows; const start = lineStart(p.gpa, f, f.scroll -| slack); const end = @max(start, lineStart(p.gpa, f, f.scroll + pane.rows + SYNTAX_CONTEXT_AFTER_ROWS + slack)); - const new_highlights = syntax.highlightFileRange(p.tree_sitter_gpa, f.path, f.content, start, end) catch { + const new_highlights = (switch (pane.colorAlgo()) { + .diff => syntax.highlightDiff(p.tree_sitter_gpa, f.content, start, end), + else => syntax.highlightFileRange(p.tree_sitter_gpa, f.path, f.content, start, end), + }) catch { f.syntax_dirty = false; continue; }; -- cgit v1.3