From 191d0eca0ba25b94ce2b466cc11b879e7553473a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 00:41:26 -0300 Subject: 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 --- src/main.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.zig') diff --git a/src/main.zig b/src/main.zig index ed20dceb..1e5bf9f4 100644 --- a/src/main.zig +++ b/src/main.zig @@ -133,7 +133,7 @@ const help_text = /// `pardes -` inside a session: `text`, stdin as it came, escapes and all, /// into a new +Pager of the directory (/pager): /// written after the directory on that one open, the session parses it -/// (pager.zig) and puts it in as one undo step, left clean. A text the +/// (Term.page) and puts it in as one undo step, left clean. A text the /// session would not take is never lost: it goes to stderr, a terminal, /// with why, and the exit is 1. fn pageInto(io: std.Io, gpa: std.mem.Allocator, dial: []const u8, text: []const u8) void { @@ -167,7 +167,7 @@ fn pageInto(io: std.Io, gpa: std.mem.Allocator, dial: []const u8, text: []const } /// Stdin to its end, as it came (its escapes are the session's to parse, -/// pager.zig), at most a file's limit, a longer one cut there and said so +/// Term.page), at most a file's limit, a longer one cut there and said so /// at its end. fn readStdinText(io: std.Io, gpa: std.mem.Allocator) ![]u8 { const limit = pardes.memory.limits.max_file_bytes; -- cgit v1.3