summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-02 00:58:20 -0300
committerGabriel Schneider <[email protected]>2026-10-02 00:58:20 -0300
commit39d4a7c38b12f907d8ba6c08bb14600b503a13d7 (patch)
tree7ab29d0a3ebe12958019ef46d58e68506d91d615 /src/ninep/ctl.zig
parent6637d8df988f8cff9d054c39d3781f4a1ede3b8e (diff)
downloadpardes-39d4a7c38b12f907d8ba6c08bb14600b503a13d7.tar.gz
pardes-39d4a7c38b12f907d8ba6c08bb14600b503a13d7.zip
Get of a file not there, or of a directory, says so before asking about unsaved edits; the init file saved in a pane logs a bad line as err - init file line N, as startup does, its commands still not run again
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index dc5e8386..c9ce41e1 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -2173,6 +2173,20 @@ test "round 39's small refusals: one name an open, small scratches unasked, twin
try testing.expectEqualStrings("f\n", scratch.file.?.content);
}
+test "Get of a file not there says so without asking about unsaved edits; the init file saved says a bad line as startup does" {
+ const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .startup_config = "Theme dusk\n", .startup_config_path = "/tmp/pardes-init-test/init" });
+ defer p.deinit();
+ const pane = try p.setTestFile("x\n");
+ _ = wr(p, Node.of(pane.serial, .body), "unsaved\n");
+ try testing.expect(p.executeBuiltinLine(0, "Get /tmp/pardes-surely-no-such-file.txt"));
+ try testing.expect(th.logHas(p, "no such file"));
+ try testing.expect(!th.logHas(p, "again to discard"));
+ try testing.expect(pane.discard_warned == null);
+ pardes.exec.reapplyInitFile(p, "/tmp/pardes-init-test/init", "Theme acme\nnosuchword 1\nNewcol\n");
+ try testing.expect(th.logHas(p, "err - init file line 2: unknown word \"nosuchword 1\""));
+ try testing.expect(!th.logHas(p, "init file line 3"));
+}
+
test "a body write to a terminal is typed input, not a paste, even to a program that asked for bracketed paste" {
const p = try Pardes.init(testing.allocator, .{ .cols = 90, .rows = 30 });
defer p.deinit();