From 589269c0b3ca74a29f5889fa6e781e59cef7efdb Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 2 Jul 2026 21:56:01 -0300 Subject: wasm replay ui --- paint.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'paint.zig') diff --git a/paint.zig b/paint.zig index d8526cb4..2f953a5a 100644 --- a/paint.zig +++ b/paint.zig @@ -2,8 +2,10 @@ const std = @import("std"); const ui = @import("ui"); const app_config = @import("app_config"); const ghostty_vt = @import("ghostty-vt"); -const ts = @import("tree-sitter"); -const ts_queries = @import("ts_queries"); +const ts = if (app_config.syntax_highlighting) @import("tree-sitter") else struct { + pub const Language = opaque {}; +}; +const ts_queries = if (app_config.syntax_highlighting) @import("ts_queries") else struct {}; extern fn tree_sitter_ada() callconv(.c) *const ts.Language; extern fn tree_sitter_bash() callconv(.c) *const ts.Language; @@ -166,6 +168,7 @@ fn extIs(ext: []const u8, comptime choices: anytype) bool { } pub fn highlightFile(gpa: std.mem.Allocator, path: []const u8, content: []const u8) ![]u8 { + if (!app_config.syntax_highlighting) return &.{}; const ext = std.fs.path.extension(path); var lang: *const ts.Language = undefined; var query_src: []const u8 = undefined; -- cgit v1.3