summaryrefslogtreecommitdiff
path: root/src/Output.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-29 17:01:35 -0300
committerGabriel Schneider <[email protected]>2026-10-29 21:13:33 -0300
commit70de5ec5ff3dad01afcc45244ad5e5a481486da6 (patch)
treecd4b723dcc2cfd94c4ba2361c134927b0e2df60b /src/Output.zig
parent349790339897466f323ff28748916aa48aa344f7 (diff)
downloadpardes-70de5ec5ff3dad01afcc45244ad5e5a481486da6.tar.gz
pardes-70de5ec5ff3dad01afcc45244ad5e5a481486da6.zip
dump: one walker dump of the whole session, by name across builds, for Restore, -l, Handover and the store; dump.zig's hand-written schema gone
A dump is walk.zig's walk of the core with a table of every type it reaches (fields, enum and union names, number widths), read back by name; terminals are ghostty's snapshot (screens, history, kitty images); a failed load frees what it made. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/Output.zig')
-rw-r--r--src/Output.zig34
1 files changed, 2 insertions, 32 deletions
diff --git a/src/Output.zig b/src/Output.zig
index 83914d52..29e49180 100644
--- a/src/Output.zig
+++ b/src/Output.zig
@@ -7,7 +7,6 @@ const exec = @import("exec.zig");
const config = @import("config.zig");
const Pardes = pardes.Pardes;
const modal = @import("modal.zig");
-const dump = @import("dump.zig");
const limits = @import("memory.zig").limits;
const builtins = @import("builtins.zig");
const effect_sources = @import("effect_sources.zig");
@@ -40,7 +39,8 @@ pub const Origin = union(enum) {
preview,
};
-pub const max_arg = dump.max_origin_arg;
+/// An output's argument is typed in the bounded one-line tag storage.
+pub const max_arg = limits.max_tag_tail;
pub const State = struct {
pub const replica = .{ .len = .{.{ "arg_buf", "arg_len" }} };
@@ -320,36 +320,6 @@ pub fn grain(out: ?State) Grain {
return if (tr.steps) .line else .word;
}
-pub fn word(o: Origin) []const u8 {
- return switch (o) {
- .cmd => |b| @tagName(b),
- .query => |k| @tagName(k),
- .search => "/",
- .errors => config.errors_buffer,
- .pdf_links => config.pdf_links_buffer,
- .unsaved => config.unsaved_buffer,
- .dir => dir_word,
- .preview => config.preview_buffer,
- };
-}
-
-/// A directory pane's origin as a dump names it.
-const dir_word = "dir";
-
-pub fn fromWord(w: []const u8) ?Origin {
- if (w.len == 0) return null;
- if (std.mem.eql(u8, w, "/")) return .search;
- if (std.mem.eql(u8, w, config.errors_buffer)) return .errors;
- if (std.mem.eql(u8, w, config.pdf_links_buffer)) return .pdf_links;
- if (std.mem.eql(u8, w, config.unsaved_buffer)) return .unsaved;
- if (std.mem.eql(u8, w, dir_word)) return .dir;
- if (std.mem.eql(u8, w, config.preview_buffer)) return .preview;
- if (std.meta.stringToEnum(Builtin, w)) |b|
- if (builtins.registry.outputTraits(b) != null) return .{ .cmd = b };
- if (std.meta.stringToEnum(lsp.Kind, w)) |k| return .{ .query = k };
- return null;
-}
-
pub fn resultsFrom(p: *Pardes, pane: *Pane, from: Origin) bool {
const rp = p.panes[pane.search_pane orelse return false] orelse return false;
const f = rp.file orelse return false;