From e2b18ea6897057bd481f7c59d1617677dc2928e9 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 14:03:13 -0300 Subject: A Recent or Jumplist row for a file that shrank lands on its last line, the same by either route, and says so A +Recent row clamped silently and a Jumplist row missed (has no line N). Both are remembered places now: the look clamps to the file as it is, closed or open, and the message row says has N lines now: at its last. Co-Authored-By: Claude Opus 5.5 --- src/ninep/ctl.zig | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ninep/ctl.zig') diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index e31b9e67..2e6ed6db 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -2642,6 +2642,13 @@ test "a remembered place is clamped to the file as it is now, its selection's tw try testing.expect(back.body.vsel.active); // Its ends clamped to the last character, `two`'s `o`, not its newline. try testing.expect(back.body.cur_col <= 2 and back.body.vsel.col <= 2); + try testing.expect(std.mem.indexOf(u8, back.msg[0..back.msg_len], "c.txt has 2 lines now: at its last") != null); + // The same row with the file open: the same place, said the same way. + _ = wr(p, Node.of(rows.serial, .look), loc); + p.sync(); + try testing.expectEqual(back.serial, p.panes[p.active].?.serial); + try testing.expect(back.body.cur_row <= 1); + try testing.expect(std.mem.indexOf(u8, back.msg[0..back.msg_len], "at its last") != null); } test "size is monotonic: growing is never refused, and a size once taken is taken again" { -- cgit v1.3