diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 06:43:39 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 96383331f09e8af3fa24f767b3c56863309723b8 (patch) | |
| tree | 12aa88b5e4832623de2c3a413b7b237f6ef34add /src/mouse.zig | |
| parent | 35e865eba278a1ef48a6ce160767d652a9c54ae8 (diff) | |
| download | pardes-96383331f09e8af3fa24f767b3c56863309723b8.tar.gz pardes-96383331f09e8af3fa24f767b3c56863309723b8.zip | |
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 <[email protected]>
Diffstat (limited to 'src/mouse.zig')
| -rw-r--r-- | src/mouse.zig | 9 |
1 files changed, 6 insertions, 3 deletions
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; |
