diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-02 21:56:01 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | 589269c0b3ca74a29f5889fa6e781e59cef7efdb (patch) | |
| tree | ecd2ce3060d06353f3b6302e70abf784295ff40f /paint.zig | |
| parent | 81992cc92743a98066ee1a9025bc74f91cf0e967 (diff) | |
| download | pardes-589269c0b3ca74a29f5889fa6e781e59cef7efdb.tar.gz pardes-589269c0b3ca74a29f5889fa6e781e59cef7efdb.zip | |
wasm replay ui
Diffstat (limited to 'paint.zig')
| -rw-r--r-- | paint.zig | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |
