From 682e237df7e8b22f820d14a4adee58e6e2f84268 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 11 Sep 2026 12:38:56 -0300 Subject: trunk: resume before the Reload experiment Empty marker on the last pre-Reload change. Keep the Reload experiment on reload (3801914), its first change on reload-start (200a1fc), and the unfinished performance investigation on reload-perf-wip. --- src/dump.zig | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/dump.zig') diff --git a/src/dump.zig b/src/dump.zig index 93bf08cc..ff46205f 100644 --- a/src/dump.zig +++ b/src/dump.zig @@ -109,6 +109,7 @@ pub const Pane = struct { cols: u16 = 0, rows: u16 = 0, vweight: f32 = 1, + collapsed: bool = false, /// Exact editable tail when the user touched it. Null retains the live /// default; a present empty slice deliberately restores an empty tail. tag_tail: ?[]const u8 = null, @@ -118,6 +119,7 @@ pub const Pane = struct { }; pub const Column = struct { + tag: ?[]const u8 = null, weight: f32 = 1, panes: []const usize = &.{}, }; @@ -130,13 +132,20 @@ pub const State = struct { screen: Size, active: usize = 0, topbar: []const u8 = "", + topbar_custom: ?[]const u8 = null, theme: []const u8 = "dark", columns: []const Column = &.{}, panes: []const Pane = &.{}, mounts: []const Mount = &.{}, }; +fn validateTag(bar: []const u8) !void { + if (bar.len > limits.max_tag_tail or std.mem.indexOfAny(u8, bar, "\r\n\x00") != null or !std.unicode.utf8ValidateSlice(bar)) return error.BadDumpTag; +} + pub fn validate(state: State) !void { + if (state.topbar_custom) |bar| try validateTag(bar); + for (state.columns) |column| if (column.tag) |bar| try validateTag(bar); if (!std.mem.eql(u8, state.magic, magic)) return error.BadDumpMagic; if (state.version != version) return error.BadDumpVersion; if (state.panes.len == 0 or state.panes.len > max_panes) return error.BadDumpPanes; -- cgit v1.3