diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 23:04:59 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 01:00:58 -0300 |
| commit | 7053362c704d94b73bbb2ce9fb104321060661da (patch) | |
| tree | ad6403790b445bd8d9ff7de901dcd3aec4ea2406 /test | |
| parent | 15c9ac31ab95541df4f8e3740e4b1b6e1b25155b (diff) | |
| download | pardes-7053362c704d94b73bbb2ce9fb104321060661da.tar.gz pardes-7053362c704d94b73bbb2ce9fb104321060661da.zip | |
placement under Tagbottom: a look from a pane's text goes under its text with every line of it in sight above its tag (test/behaviour/placement.zig), which pins layout's split arithmetic, a pane's tag plus its text at either end, that the survey's Tagbottom fix would have broken (it hides the last line), and says so at layout.bodyTop
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test')
| -rw-r--r-- | test/behaviour/placement.zig | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/behaviour/placement.zig b/test/behaviour/placement.zig index 73d69883..f6823feb 100644 --- a/test/behaviour/placement.zig +++ b/test/behaviour/placement.zig @@ -108,6 +108,29 @@ test "placement: a look from a pane's text goes under its text when it has many try std.testing.expectEqual(was[big][0] + was[big][1], now[big + 1][0] + now[big + 1][1]); } +test "placement: under Tagbottom a look from a pane's text goes under its text too, every line of it still in sight above its tag" { + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "second.txt", .data = "second\n" }); + var dir: [4096]u8 = undefined; + const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; + var s = try Session.initFile(std.testing.allocator, "alpha\nbeta\ngamma\n"); + defer s.deinit(); + s.detach(); + try s.write("/ctl", "size 200 60\n"); + try s.write("/ctl", "Tagbottom on\n"); + const top = try s.focused(); + try s.write(s.at("/pane/{d}/look", .{top}), s.at("{s}/second.txt\n", .{at})); + // The first pane keeps its three lines with its tag under them, at its + // foot: the split leaves it its tag and its text whichever end the tag + // is on (makenewwindow, util.c:482-486). The new pane starts below. + const alpha = (try s.where("alpha"))[1]; + try std.testing.expectEqual(alpha + 1, (try s.where("beta"))[1]); + try std.testing.expectEqual(alpha + 2, (try s.where("gamma"))[1]); + try std.testing.expectEqual(alpha + 3, try tagRow(&s, "/test.txt")); + try std.testing.expectEqual(alpha + 4, (try s.where("second"))[1]); +} + test "placement: a look from the middle of a column splits only the pane it came from, short ones round it kept short, through a Newcol too" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); |
