summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/divergences.md2
-rw-r--r--docs/fs.md1
-rw-r--r--src/dump.zig20
3 files changed, 19 insertions, 4 deletions
diff --git a/docs/divergences.md b/docs/divergences.md
index 6560368c..17179029 100644
--- a/docs/divergences.md
+++ b/docs/divergences.md
@@ -18,8 +18,6 @@ moving a bookmark does not quietly orphan work or hide a failure.
## Known wrong on `main`
-- `Dump` of a session with more than 6 columns fails `Dump: bad dump
- columns` (`src/dump.zig` `max_cols` is 6; a session holds 16).
- `pardes FILE` in a pane forwards only a FILE that exists; a new file name
starts a separate editor instead of opening a pane in the session.
- `Dump` fails `no such directory` when the default `DumpDir`'s parent
diff --git a/docs/fs.md b/docs/fs.md
index e4750690..2e2f1453 100644
--- a/docs/fs.md
+++ b/docs/fs.md
@@ -646,7 +646,6 @@ become spaces.
| undo | 256 steps |
| log | 64 KiB ring; `msg` 256 bytes, `err` reason 200 |
| `pty/run` output | 64 KiB |
-| a dump | 6 columns (so `Dump` of more fails `bad dump columns`) |
| file name component | 255 bytes |
## Source and tests
diff --git a/src/dump.zig b/src/dump.zig
index fca88a2d..194c1ed3 100644
--- a/src/dump.zig
+++ b/src/dump.zig
@@ -129,7 +129,7 @@ pub fn defaultDirectory(buf: []u8) ?[]const u8 {
pub const magic = "pardes-dump";
pub const version: u32 = 1;
pub const max_panes: usize = MAX_PANES;
-pub const max_cols: usize = 6;
+pub const max_cols: usize = MAX_COLS;
/// Output arguments are typed in the same bounded one-line tag storage. Keep
/// the schema limit named independently so a dump reader can validate it
/// without importing the output-pane implementation. The bound itself is
@@ -987,6 +987,24 @@ test "a dump keeps the settings that differ from a fresh session's, and a restor
try std.testing.expect(!restored.settings.verbose);
}
+test "a session with every column it may hold dumps and restores them all" {
+ const gpa = std.testing.allocator;
+ const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 1200, .rows = 24 });
+ defer p.deinit();
+ while (p.ncol < MAX_COLS) {
+ layout.compute(p);
+ var widest: usize = 0;
+ for (0..p.ncol) |c| if (p.col_w[c] > p.col_w[widest]) {
+ widest = c;
+ };
+ _ = layout.insertColumn(p, widest, false) orelse return error.NoColumn;
+ }
+ try dumpState(p);
+ const restored = try initFromDump(gpa, .{ .tty_only = true, .cols = 1200, .rows = 24 }, p.dump_out.?);
+ defer restored.deinit();
+ try std.testing.expectEqual(@as(usize, MAX_COLS), restored.ncol);
+}
+
test "a restored pane keeps its dot, as acme's dump keeps a window's" {
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true });