From 5f41a03fdcf0eaa3c1917e0f94243878c481cf8b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 19:11:53 -0300 Subject: Incl dir ... adds directories a look at a name found nowhere else is tried in, as acme's includename, too; bare Incl lists them and Incl - empties them; the session's, seeded with /usr/include and /usr/local/include, kept in a dump; Indent's refusal says Enter keeps the indent always Co-Authored-By: Claude Opus 5.5 --- src/dump.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/dump.zig') diff --git a/src/dump.zig b/src/dump.zig index 005770e1..b64441d3 100644 --- a/src/dump.zig +++ b/src/dump.zig @@ -302,6 +302,8 @@ pub const State = struct { /// config are kept on their own, and the font is the frontend's. Absent /// in older dumps. settings: []const []const u8 = &.{}, + /// Incl's directories, in order; null in older dumps (the defaults). + incl: ?[]const []const u8 = null, }; /// A header is a text like any other: it may hold newlines, but not a @@ -798,6 +800,7 @@ pub fn dumpState(p: *Pardes) !void { .panes = dump_panes[0..panes_len], .mounts = mounts[0..p.fs.mounts.items.len], .settings = try changedSettings(p, arena), + .incl = p.incl.items, }; try validate(state); var out: std.Io.Writer.Allocating = .init(p.gpa); @@ -902,6 +905,14 @@ fn initDump(gpa: std.mem.Allocator, opts: Options, zon_bytes: []const u8, previo p.locations_config = st.locations_config; p.settings.tree_context_tag_style = st.tree_context_tag_style; applySettings(p, st.settings); + if (st.incl) |dirs| { + for (p.incl.items) |dir| p.gpa.free(dir); + p.incl.clearRetainingCapacity(); + for (dirs) |dir| if (dir.len > 0 and dir[0] == '/' and std.mem.indexOfScalar(u8, dir, 0) == null) { + const copy = p.gpa.dupe(u8, dir) catch continue; + p.incl.append(p.gpa, copy) catch p.gpa.free(copy); + }; + } // A dump naming a ThemeFile asks the host to load it again: until it // has, and for good if it fails, the theme this session showed goes on // (a failed ThemeFile changes nothing, a Restore's included), unless -- cgit v1.3