summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index b42bf643..571f7db4 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -19,7 +19,7 @@ pub const tagline = @import("tagline.zig");
pub const exec = @import("exec.zig");
const recent_files = @import("recent.zig");
const Store = @import("Store.zig");
-const Db = @import("Db.zig");
+pub const Db = @import("Db.zig");
pub const mouse = @import("mouse.zig");
pub const normal = @import("normal.zig");
pub const edit = @import("edit.zig");
@@ -3540,6 +3540,9 @@ pub const Pardes = struct {
clip_pending: ?edit.ClipRequest = null,
/// the last serialized dump (gpa-owned), read by the write_dump effect
dump_out: ?[]u8 = null,
+ /// Where the last Dump goes as a file of its own (`Dump export`; gpa-
+ /// owned), else the state file.
+ dump_export: ?[]u8 = null,
/// where the shell wrote the last dump (shell reports back after
/// write_dump); shown in the topbar as `Restore <path>`
last_dump: ?[]const u8 = null,
@@ -3602,7 +3605,7 @@ pub const Pardes = struct {
"parked", "undrawn",
// How this process was started, and the last dump it made for
// its host to write: a session loaded elsewhere has its own.
- "opts", "dump_out",
+ "opts", "dump_out", "dump_export",
},
.derived = .{ "shell_rows", "diff_output", "locations_cache", "retired_panes", "tty_filter_palette", "body_chrome" },
// The host's handles, the 9P server's fids and log, the state file
@@ -3906,6 +3909,8 @@ pub const Pardes = struct {
// Every file open now is closed with its dot, and the list kept.
for (p.panes) |slot| if (slot) |pane| p.noteClosed(pane);
p.db.writeRecent(p, true);
+ // The state file compacted once it is mostly what no moment holds.
+ p.db.compact(p);
p.db.deinit();
p.store.deinit(p.recentGpa());
p.recent.deinit(p.recentGpa());
@@ -3931,6 +3936,7 @@ pub const Pardes = struct {
p.macro.deinit(gpa);
if (p.retired_edit) |r| gpa.free(r);
if (p.dump_out) |d| gpa.free(d);
+ if (p.dump_export) |d| gpa.free(d);
p.fallback.deinit();
if (p.last_dump) |d| gpa.free(d);
if (p.custom_theme) |theme_value| gpa.free(theme_value.name);