summaryrefslogtreecommitdiff
path: root/src/file_pane.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_pane.zig')
-rw-r--r--src/file_pane.zig5
1 files changed, 4 insertions, 1 deletions
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;
};