summaryrefslogtreecommitdiff
path: root/core/dump.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/dump.zig')
-rw-r--r--core/dump.zig24
1 files changed, 20 insertions, 4 deletions
diff --git a/core/dump.zig b/core/dump.zig
index 2806e445..ad436ac5 100644
--- a/core/dump.zig
+++ b/core/dump.zig
@@ -667,13 +667,29 @@ fn loadAndRevive(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, previ
/// is dropped, its words computed now (K'1); any other is the user's text,
/// kept as it is. Here, where a Restore, a start from a dump and an
/// Upgrade load (a replica's join loads its authority's, dropped there).
+/// The window's and the columns' tags the same (UX K'2): the window row of
+/// either build, with its `Restore <path>` or without, and the column tag
+/// it had.
fn dropOldTags(p: *Pardes) void {
for (p.panes) |slot| if (slot) |pane| if (pane.tag.own) |own| {
- if (!std.mem.eql(u8, own, pardes.tagline.kindTail(pane))) continue;
- p.gpa.free(own);
- pane.tag.own = null;
- pane.tag.cur_pinned = false;
+ if (std.mem.eql(u8, own, pardes.tagline.kindTail(pane))) dropOwn(p, &pane.tag);
};
+ const window: []const u8 = p.global_tag.own orelse "";
+ for ([_][]const u8{ pardes.config.topbar_window_str, pardes.config.topbar_terminal_str }) |old| {
+ if (!std.mem.startsWith(u8, window, old)) continue;
+ if (window.len != old.len and !std.mem.startsWith(u8, window[old.len..], " Restore ")) continue;
+ dropOwn(p, &p.global_tag);
+ break;
+ }
+ for (&p.views) |*slot| if (slot.*) |*v| for (v.col_tags[0..v.ncol]) |*t| {
+ if (t.own) |own| if (std.mem.eql(u8, own, pardes.tagline.column_tag_default)) dropOwn(p, t);
+ };
+}
+
+fn dropOwn(p: *Pardes, t: *pardes.panes.Text) void {
+ p.gpa.free(t.own.?);
+ t.own = null;
+ t.cur_pinned = false;
}
/// A loaded core given to this host (with `revivePane` for each of its