summaryrefslogtreecommitdiff
path: root/src/Core.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 00:41:26 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit191d0eca0ba25b94ce2b466cc11b879e7553473a (patch)
tree3f1c9d40eff76e16a2085dc5e72d7628928a423f /src/Core.zig
parent26929e67111e843db4ad27abb4f1341cf396158c (diff)
downloadpardes-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/Core.zig')
-rw-r--r--src/Core.zig5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Core.zig b/src/Core.zig
index 62f54416..4d24dcc7 100644
--- a/src/Core.zig
+++ b/src/Core.zig
@@ -72,7 +72,6 @@ const memory = pardes.memory;
const modal = pardes.modal;
const mouse = pardes.mouse;
const newer_build_words = pardes.newer_build_words;
-const pager = pardes.pager;
const platform = pardes.platform;
const recent_files = @import("recent.zig");
const sel_slot = pardes.sel_slot;
@@ -566,7 +565,7 @@ fn initSession(gpa: std.mem.Allocator, opts: Options) !*Pardes {
p.oneColumn();
},
.stdin => {
- const page = try pager.parse(gpa, opts.stdin_text.?);
+ const page = try pardes.Term.page(gpa, opts.stdin_text.?);
errdefer gpa.free(page.spans);
const content = page.text;
errdefer gpa.free(content);
@@ -2169,7 +2168,7 @@ pub const Options = struct {
file: ?[]const u8 = null,
file_line: usize = 0,
missing: ?struct { word: []const u8, dir: []const u8 } = null,
- /// `pardes -`: stdin as it came, for a +Pager pane at boot (pager.zig
+ /// `pardes -`: stdin as it came, for a +Pager pane at boot (Term.page
/// parses it).
stdin_text: ?[]const u8 = null,
tty_toggle: u21 = config.tty_toggle_default,