diff options
Diffstat (limited to 'term.zig')
| -rw-r--r-- | term.zig | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -37,6 +37,9 @@ pub const File = struct { path: []const u8, // gpa-owned absolute path content: []u8, // gpa-owned file bytes scroll: usize = 0, // top visible file line + /// tree-sitter syntax styles, one byte per `content` byte (0 = none). Empty + /// when the file's language isn't highlighted. gpa-owned. See main.highlightFile. + highlights: []u8 = &.{}, }; /// A run of inserted ("char mode") text. `col` is the ORIGINAL tty column it is @@ -121,6 +124,7 @@ pub fn deinit(self: *Term, io: std.Io, gpa: std.mem.Allocator) void { if (self.file) |f| { gpa.free(f.path); gpa.free(f.content); + if (f.highlights.len > 0) gpa.free(f.highlights); } else if (self.image) |iv| { gpa.free(iv.path); } else { |
