From 96383331f09e8af3fa24f767b3c56863309723b8 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 06:43:39 -0300 Subject: A terminal keeps its tag and two body rows through drags, squeezes and a smaller window A terminal of one body row loses its prompt's mark and reads busy for ever. Placement already refused to make one that short; now layout never leaves one there either: a grip drag stops at the floor, and a column squeezed by weights or by the window takes the rows from its other panes. Text panes keep acme's way and can still be dragged to their tag, since acme has no terminals to follow. The shrinktag, splitparent and cornerdrag goldens are re-recorded for it, shrinktag's re-grab moved to where the grip now is. Co-Authored-By: Claude Opus 5.5 --- src/mouse.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mouse.zig') diff --git a/src/mouse.zig b/src/mouse.zig index cb5512ad..9eefa9a1 100644 --- a/src/mouse.zig +++ b/src/mouse.zig @@ -109,20 +109,23 @@ test "a pane's last row of text is no resize handle; the rule over the next pane try std.testing.expect(nudgeRightSeam(p, 2) == seam + 2); } -test "a pane's grip dragged up or down its own column moves its top, down to a tag alone above" { +test "a pane's grip dragged up or down its own column moves its top, down to the floor of the pane above" { if (platform == .web) return; const p = try cornerFixture(std.testing.allocator); defer p.deinit(); const upper = p.col_panes[1][0]; const lower = p.col_panes[1][1]; const grip_x = p.rects[lower].x; - // Up, past the pane above's first row: it keeps one row, its tag. + // Up, past the pane above's first row: a text pane keeps its tag, a + // terminal its tag and two rows (layout.floorRows). const top = p.rects[upper].y; + const above = p.panes[upper].?; + const floor: u16 = if (above.isTerminal()) above.tag_rows + layout.min_body_rows else 1; p.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = grip_x, .row = p.rects[lower].y } }); p.update(.{ .mouse = .{ .button = .left, .kind = .drag, .col = grip_x, .row = top } }); p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = grip_x, .row = top } }); p.sync(); - try std.testing.expectEqual(@as(u16, 1), p.rects[upper].h); + try std.testing.expectEqual(floor, p.rects[upper].h); try std.testing.expectEqual(lower, p.col_panes[1][1]); // Down, inside itself: its top follows, the pane above taking the rows. const to = p.rects[lower].y + 6; -- cgit v1.3