summaryrefslogtreecommitdiff
path: root/src/Text.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 /src/Text.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 'src/Text.zig')
-rw-r--r--src/Text.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text.zig b/src/Text.zig
index 764b8a6a..56ee199b 100644
--- a/src/Text.zig
+++ b/src/Text.zig
@@ -11,6 +11,7 @@ const std = @import("std");
const panes = @import("panes.zig");
const modal = @import("modal.zig");
const config = @import("config.zig");
+const memory = @import("memory.zig");
const Pane = panes.Pane;
const File = panes.File;
const Terminal = panes.Terminal;
@@ -36,7 +37,7 @@ pub const CharSel = struct {
explicit: bool = false,
};
-pub const max_selections = 64;
+pub const max_selections = memory.limits.selections;
pub const SelRange = struct {
row: i32,
@@ -60,7 +61,7 @@ cur_col: i32 = 0,
msel: LineSel = .{},
vsel: CharSel = .{},
sels: [max_selections - 1]SelRange = undefined,
-nsel: u8 = 0,
+nsel: u16 = 0,
select: bool = false,
/// sticky goal column for j/k runs (helix old_visual_position): any
/// non-vertical range write resets it to -1.