summaryrefslogtreecommitdiff
path: root/paint.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-02 21:56:01 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commit589269c0b3ca74a29f5889fa6e781e59cef7efdb (patch)
treeecd2ce3060d06353f3b6302e70abf784295ff40f /paint.zig
parent81992cc92743a98066ee1a9025bc74f91cf0e967 (diff)
downloadpardes-589269c0b3ca74a29f5889fa6e781e59cef7efdb.tar.gz
pardes-589269c0b3ca74a29f5889fa6e781e59cef7efdb.zip
wasm replay ui
Diffstat (limited to 'paint.zig')
-rw-r--r--paint.zig7
1 files changed, 5 insertions, 2 deletions
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;