summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 11:30:08 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit35f06a55bad1891e3d5e779630b232b2c322bc83 (patch)
tree9b6e3bc3b02667c8849cdad54ebf3d5cd7a7225c /src/ninep/ctl.zig
parent0e6501ce210481c095e6f70a27e7f125f7af3761 (diff)
downloadpardes-35f06a55bad1891e3d5e779630b232b2c322bc83.tar.gz
pardes-35f06a55bad1891e3d5e779630b232b2c322bc83.zip
/recent shows a name as /index does, a newline in it escaped
It printed paths raw, so a name holding a newline read as two rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 92342525..4abb6fcd 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -2300,6 +2300,14 @@ test "Back and Forward over a closed file's entries: one reopen is that file's p
try testing.expectEqual(c_serial, p.panes[p.active].?.serial);
}
+test "/recent shows a name as /index does, a newline in it escaped" {
+ const p = try withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ p.recent.opened(p.recentGpa(), "/tmp/a\nb\\c");
+ const text = rd(p, @intFromEnum(tree.TopFile.recent), 0, 8192).bytes;
+ try testing.expect(std.mem.indexOf(u8, text, "closed /tmp/a\\nb\\\\c\n") != null);
+}
+
test "a remembered place is clamped to the file as it is now, its selection's two ends kept where they fit" {
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();