diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 23:02:01 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 01:16:28 -0300 |
| commit | 4423bc2f88fe2e88202056d6a11f759b4b143b74 (patch) | |
| tree | 2e19a95e97a38088a288444b0e298251fe911506 /src/syntax.zig | |
| parent | adc8a50289f17ba15867f6d8e45844f57ee1aaa8 (diff) | |
| download | pardes-4423bc2f88fe2e88202056d6a11f759b4b143b74.tar.gz pardes-4423bc2f88fe2e88202056d6a11f759b4b143b74.zip | |
modal, selection_pipe, syntax, sam_edit: helpers used once are inlined where they are used (consumeCount, clampLineCol, codepointAtCursor, isWordBoundary, wmIsPrev, tokenStopped, dropDiffPieces, Exec.text), and moveWord's doc comment goes back above moveWord
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/syntax.zig')
| -rw-r--r-- | src/syntax.zig | 14 |
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 |
