diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 13:24:06 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | e11048c20a50b67841e648a4d5ddd7490bc9c9b7 (patch) | |
| tree | 2f4737d83c5f894e8b7a68e5798bd2a2cebb70b9 /src/Terminal.zig | |
| parent | e0b5564f04aa0ae6666f29ef29c768d800fbabce (diff) | |
| download | pardes-e11048c20a50b67841e648a4d5ddd7490bc9c9b7.tar.gz pardes-e11048c20a50b67841e648a4d5ddd7490bc9c9b7.zip | |
Paint into a target Surface instead of swapping the frame's out
The painters of a pane's body and tag (renderBody and its selection,
gutter, syntax, ANSI and wrap-marker passes; paintPaneTag; paintHeaders;
renderPane; the image and PDF grid paths) take the Surface they paint as a
parameter. The body layer and the tag layers paint straight into their own
temporary surfaces, and the std.mem.swap of p.surface around those calls is
gone. No behaviour change.
Diffstat (limited to 'src/Terminal.zig')
| -rw-r--r-- | src/Terminal.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Terminal.zig b/src/Terminal.zig index cd292e5f..62a77ca8 100644 --- a/src/Terminal.zig +++ b/src/Terminal.zig @@ -5,6 +5,7 @@ const std = @import("std"); const pardes = @import("pardes.zig"); const config = @import("config.zig"); const Pardes = pardes.Pardes; +const Surface = pardes.Surface; const modal = @import("modal.zig"); const tracy = @import("tracy.zig"); const dump = @import("dump.zig"); @@ -1756,11 +1757,10 @@ const Anchor = struct { } }; -pub fn recolorAnsi(p: *Pardes, pane: *Pane, r: pardes.Rect, tx: u16, tw: u16, body_h: u16, body: []const u8) void { +pub fn recolorAnsi(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, tx: u16, tw: u16, body_h: u16, body: []const u8) void { // No emulator, no ANSI cells: the whole pass — and the 256-colour theme // projection behind it — is compiled out. if (comptime !enabled) return; - const s = &p.surface; if (pane.terminal == null) return; const body_y = p.bodyTop(pane, r); var filtered_storage: FilteredColors = undefined; |
