diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 00:41:26 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | 191d0eca0ba25b94ce2b466cc11b879e7553473a (patch) | |
| tree | 3f1c9d40eff76e16a2085dc5e72d7628928a423f /src/ninep/ctl.zig | |
| parent | 26929e67111e843db4ad27abb4f1341cf396158c (diff) | |
| download | pardes-191d0eca0ba25b94ce2b466cc11b879e7553473a.tar.gz pardes-191d0eca0ba25b94ce2b466cc11b879e7553473a.zip | |
pager: one parser, the terminal's: a +Pager's page is read through the interface (Term.page, bytes in, its printed text and SGR spans out, Term.Page and Term.Span plain records), by ghostty-vt's stream as before kqrzvrmm, the handler that keeps the text, the spans and the overstrike moving with it to src/term/pager.zig; pager.zig's own parser (its ECMA-48 states, CSI limits and SGR reading) and src/pager.zig go, so two parsers cannot drift apart, and its tests stay with the page (the colon colours, 8-bit CSI, REP, CHT and CNL test kept, true by construction now); a 32 MiB coloured log pages in 2,074M instructions through the interface against 2,292M with the parser it replaces (ReleaseFast, a bench run once then removed; the same text and spans); Term.zig's tests take term/pager.zig's in; the changelog says the pager's own parser no more; pagercolor and every golden unchanged
Diffstat (limited to 'src/ninep/ctl.zig')
| -rw-r--r-- | src/ninep/ctl.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 2e045a73..2fa24173 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -699,7 +699,7 @@ pub fn writePager(p: *Pardes, req: Req) Reply { /// The text a /pager open wrote after its directory (`held`), a program's /// output for a terminal, put in the +Pager `serial` as `pardes -` once -/// wrote it to the body: through pager.zig's parse, its colours kept +/// wrote it to the body: through the terminal's parse (Term.page), its colours kept /// as the pane's spans, one undo step, and left /// clean. Reads of the pane are its plain text. The held bytes go either way. pub fn fillPager(p: *Pardes, serial: u32, held: *std.ArrayList(u8)) error{OutOfMemory}!void { @@ -708,7 +708,7 @@ pub fn fillPager(p: *Pardes, serial: u32, held: *std.ArrayList(u8)) error{OutOfM const id = p.paneBySerial(serial) orelse return; const pane = p.panes[id].?; const f = if (pane.file) |*file| file else return; - const page = try pardes.pager.parse(p.gpa, held.items); + const page = try pardes.Term.page(p.gpa, held.items); held.clearAndFree(p.gpa); if (page.text.len == 0 and f.content.len == 0) return page.deinit(p.gpa); if (!pane.fs.nomark) panes.File.pushUndo(p, pane) catch |err| { @@ -2648,7 +2648,7 @@ test "what a /pager open writes after its directory is the text: plain in the bo try testing.expectEqual(@as(usize, 0), e.off); try testing.expectEqual(@as(usize, 0), e.removed.len); try testing.expectEqual(f.content.len, e.ins); - // An edit drops the colours (pager.zig's ponytail). + // An edit drops the colours (Term.page's ponytail). try testing.expectEqual(Status.ok, call(p, .{ .tag = 6, .op = .write, .node = Node.of(pn.serial, .body), .data = "more\n" }).reply.status); try testing.expectEqual(@as(usize, 0), f.pager_spans.len); // Undone back to the paged text: the text comes back, its colours |
