summaryrefslogtreecommitdiff
path: root/src/syntax.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.zig')
-rw-r--r--src/syntax.zig14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/syntax.zig b/src/syntax.zig
index 858ef6a2..acbe543a 100644
--- a/src/syntax.zig
+++ b/src/syntax.zig
@@ -188,7 +188,11 @@ pub fn stop() void {
spec.objects = null;
spec.objects_failed = false;
}
- dropDiffPieces();
+ for (&diff_pieces) |*slot| {
+ if (slot.*) |piece| syntax_allocator.free(piece.styles);
+ slot.* = null;
+ }
+ diff_clock = 0;
ts_set_allocator(null, null, null, null);
syntax_started = false;
syntax_allocator = undefined;
@@ -1181,14 +1185,6 @@ const DiffPiece = struct { hash: u64, styles: []u8, used: u64 };
var diff_pieces: [96]?DiffPiece = @splat(null);
var diff_clock: u64 = 0;
-fn dropDiffPieces() void {
- for (&diff_pieces) |*slot| {
- if (slot.*) |piece| syntax_allocator.free(piece.styles);
- slot.* = null;
- }
- diff_clock = 0;
-}
-
/// The styles of `content[start..end)` read as a unified diff: headers
/// muted, `@@` lines as keywords, and each hunk's code in the language of
/// the file its section names. A hunk's old side (context and removed