diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 16:24:59 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 7ce5d94b5d48b68c86d015060ebcabe63e299e1a (patch) | |
| tree | ddfbe4e1ac160cbd780c28751b5421ceca648d39 /src/memory.zig | |
| parent | 3992e9def8692710590deacbc20bd925e0f8d64a (diff) | |
| download | pardes-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 'src/memory.zig')
| -rw-r--r-- | src/memory.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/memory.zig b/src/memory.zig index 7b6ee2c0..abfd40f6 100644 --- a/src/memory.zig +++ b/src/memory.zig @@ -17,6 +17,9 @@ pub const limits = struct { pub const wrap_rows = if (board) 128 else 256; pub const undo_max = if (board) 16 else 256; pub const message_log = if (board) 16 else 128; + /// ranges one selection holds; helix has no limit, and a `%s` over a + /// file's words wants hundreds + pub const selections = if (board) 64 else 1024; /// /log's ring, which records whether or not anyone reads it. pub const log_bytes: usize = if (board) 4 * KiB else 64 * KiB; pub const max_tag_tail: usize = if (board) 512 else 4096; @@ -187,6 +190,7 @@ test "memory limits preserve desktop capacities" { try std.testing.expectEqual(256, limits.wrap_rows); try std.testing.expectEqual(256, limits.undo_max); try std.testing.expectEqual(128, limits.message_log); + try std.testing.expectEqual(1024, limits.selections); try std.testing.expectEqual(@as(usize, 4096), limits.max_tag_tail); try std.testing.expectEqual(@as(usize, 4095), limits.host_path_cap); try std.testing.expectEqual(config.embed_sources, limits.embedded_sources); |
