summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 22:48:21 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commitf0e162d287f44a562ff79e7c1d2cf81ace00c836 (patch)
tree098428d08600eef0a8eb28939cad955315dd3d95 /src/exec.zig
parent6f42f51cd652e189408eace598f99ec25b9542f8 (diff)
downloadpardes-f0e162d287f44a562ff79e7c1d2cf81ace00c836.tar.gz
pardes-f0e162d287f44a562ff79e7c1d2cf81ace00c836.zip
Dumps and init files from before 0.0.4 load no more of their old tag formats, and three orphan test scripts go
A2: a restored pane's tag tail comes from the dump's tag_tail, which every dump since 0.0.4 writes; the 27 earlier default tails that were recognised to upgrade, restoreTail, tailClass, savedPrefix and restoreTailAt, pdf_view's and image's legacySavedPrefix, a terminal's TTY tag prefix and its raw output tail replay, and the ThemeSel, FontSel and ColumnTags words (init lines and dumped output names) go, with their tests; the CHANGELOG says so. A4: test/fs_soak.py, referenced nowhere (monkey9p.py does its work). A6: test/column_grip.py and test/look_placement.py, referenced nowhere; the six review scripts docs/ui-review.md names stay. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig50
1 files changed, 1 insertions, 49 deletions
diff --git a/src/exec.zig b/src/exec.zig
index 221de105..8c062f66 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -870,58 +870,10 @@ pub fn applyStartupConfig(p: *Pardes) void {
defer p.announce = true;
var lines = std.mem.splitScalar(u8, p.opts.startup_config orelse return, '\n');
while (lines.next()) |line| {
- if (executeBuiltinLine(p, p.active, line)) continue;
- // A setting pardes no longer has is said, once, and changes nothing.
- const word = commandText(line);
- const head = word[0 .. std.mem.indexOfAny(u8, word, " \t") orelse word.len];
- if (std.mem.eql(u8, head, "ColumnTags"))
- p.setMessage(p.active, "ColumnTags: column tags are always shown now; the init line is ignored");
- // A word renamed runs as its new name, and says so, once a line.
- for ([_][2][]const u8{ .{ "ThemeSel", "Themes" }, .{ "FontSel", "Fonts" } }) |renamed| if (std.mem.eql(u8, head, renamed[0])) {
- _ = executeBuiltinLine(p, p.active, renamed[1]);
- var said: [64]u8 = undefined;
- p.setMessage(p.active, std.fmt.bufPrint(&said, "{s}: renamed to {s}", .{ renamed[0], renamed[1] }) catch "renamed");
- };
+ _ = executeBuiltinLine(p, p.active, line);
}
}
-test "an init file's ThemeSel runs as Themes and says it was renamed" {
- const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24, .startup_config = "ThemeSel\n" });
- defer p.deinit();
- var listed = false;
- for (p.panes) |slot| if (slot) |pane| if (pane.file) |f| if (f.output) |o| {
- listed = listed or std.meta.eql(o.from, panes.Output.Origin{ .cmd = .Themes });
- };
- try std.testing.expect(listed);
- // In the session's directory, not `/`.
- for (p.panes) |slot| if (slot) |pane| if (pane.file) |f| if (f.output != null)
- try std.testing.expectEqualStrings(p.sessionDir(), std.fs.path.dirname(f.path).?);
- var said = false;
- for (p.panes) |slot| if (slot) |pane| {
- said = said or std.mem.eql(u8, pane.msg[0..pane.msg_len], "ThemeSel: renamed to Themes");
- };
- try std.testing.expect(said);
- // The panes there at boot are the log's first records, before what the
- // init file said.
- const th = @import("ninep/testing.zig");
- const log = @intFromEnum(pardes.ctlfs.TopFile.log);
- const h = th.call(p, .{ .tag = 1, .op = .open, .node = log }).reply.handle;
- defer _ = th.call(p, .{ .tag = 3, .op = .release, .node = log, .handle = h });
- const text = th.call(p, .{ .tag = 2, .op = .read, .node = log, .handle = h, .size = 1 << 16 }).bytes;
- try std.testing.expectStringStartsWith(text, "new ");
-}
-
-test "an init file's retired ColumnTags line is said and ignored" {
- const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 });
- defer p.deinit();
- p.opts.startup_config = "ColumnTags\nWrap off\n";
- applyStartupConfig(p);
- try std.testing.expect(!p.settings.wrap);
- try std.testing.expect(p.columnBarHeight() > 0);
- const pane = p.panes[p.active].?;
- try std.testing.expectEqualStrings("ColumnTags: column tags are always shown now; the init line is ignored", pane.msg[0..pane.msg_len]);
-}
-
pub fn runBuiltin(p: *Pardes, b: Builtin, id: usize, txt: []const u8, arg: ?[]const u8) void {
runBuiltinFrom(p, b, id, txt, arg, false);
}