summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 16:24:59 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit7ce5d94b5d48b68c86d015060ebcabe63e299e1a (patch)
treeddfbe4e1ac160cbd780c28751b5421ceca648d39 /test/panes.zig
parent3992e9def8692710590deacbc20bd925e0f8d64a (diff)
downloadpardes-7ce5d94b5d48b68c86d015060ebcabe63e299e1a.tar.gz
pardes-7ce5d94b5d48b68c86d015060ebcabe63e299e1a.zip
A selection holds up to 1024 ranges on the desktop, 64 on the board
The limit was 64 everywhere, which helix-golf's enumerate_and_align outgrows (%s |\d+ makes 121 ranges). It is now memory.limits.selections, per platform, and the counts that hold it are u16. The ranges stay inline in each Text, so a pane grows by about 80 KiB on the desktop (three texts and the regex prompt's snapshot); the Pane size budget in Terminal.zig moves from 128 to 160 KiB and says why. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/panes.zig b/test/panes.zig
index f0e1ba3d..a56c07bf 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -305,7 +305,7 @@ const TagNavigationTests = struct {
try std.testing.expectEqual(@as(usize, 2), got.n);
for (ranges[0..got.n]) |range| try std.testing.expectEqualStrings("S", text[@min(range.anchor, range.head)..@max(range.anchor, range.head)]);
// the body's selection is its own
- try std.testing.expectEqual(@as(u8, 0), pane.body.nsel);
+ try std.testing.expectEqual(@as(u16, 0), pane.body.nsel);
// `/` from the tag is the body's search, as acme's Look from a tag is
key(p, ',');
key(p, '/');
@@ -1984,8 +1984,8 @@ test "prompt cancellation restores the selection before regex previews" {
p.update(.{ .key = .{ .cp = case.pattern[0], .text = case.pattern } });
try std.testing.expectEqual(case.secondary, pane.body.nsel);
p.update(.{ .key = .{ .cp = Key.escape } });
- try std.testing.expectEqual(@as(u8, 0), pane.body.nsel);
- try std.testing.expectEqual(@as(u8, 0), pane.nsel_snap);
+ try std.testing.expectEqual(@as(u16, 0), pane.body.nsel);
+ try std.testing.expectEqual(@as(u16, 0), pane.nsel_snap);
try std.testing.expectEqual(@as(i32, 10), pane.body.cur_col);
try std.testing.expectEqual(@as(i32, 0), pane.body.vsel.col);
try std.testing.expect(pane.body.vsel.active and pane.body.vsel.explicit);
@@ -2761,7 +2761,7 @@ const OutputTests = struct {
try fillResults(p, 0, "/", .{ .query = .hover }, "", try p.gpa.dupe(u8, "short\n"), null);
try std.testing.expectEqualStrings("short\n", result.file.?.content);
try std.testing.expect(!result.body.vsel.active and !result.body.msel.active and !result.body.select);
- try std.testing.expectEqual(@as(u8, 0), result.body.nsel);
+ try std.testing.expectEqual(@as(u16, 0), result.body.nsel);
try std.testing.expectEqual(@as(i32, 0), result.body.cur_row);
try std.testing.expectEqual(@as(i32, 0), result.body.cur_col);
try std.testing.expectEqual(@as(usize, 0), result.file.?.scroll);
@@ -4581,7 +4581,7 @@ const LookResetTests = struct {
fn cleared(pane: *const Pane) !void {
try std.testing.expect(!pane.body.msel.active);
- try std.testing.expectEqual(@as(u8, 0), pane.body.nsel);
+ try std.testing.expectEqual(@as(u16, 0), pane.body.nsel);
try std.testing.expect(!pane.body.select);
try std.testing.expectEqual(modal.Normal.State{}, pane.body.normal);
try std.testing.expect(!pane.body.restore_cursor);