summaryrefslogtreecommitdiff
path: root/main.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-03 18:49:00 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commita354d34329de597b80943c78e2afd84f235ee505 (patch)
tree6b161ea390a60864dd284a7b17dd8f025269567f /main.zig
parentf3b62fe53b19e36f21f8020831718cbf095d6a7b (diff)
downloadpardes-a354d34329de597b80943c78e2afd84f235ee505.tar.gz
pardes-a354d34329de597b80943c78e2afd84f235ee505.zip
improving layout
Diffstat (limited to 'main.zig')
-rw-r--r--main.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.zig b/main.zig
index cd760ecf..742d43b4 100644
--- a/main.zig
+++ b/main.zig
@@ -1114,6 +1114,10 @@ fn termVWeight(terms: *const [MAX_TERMS]?*Term, id: usize) ?f32 {
return if (terms[id]) |t| t.vweight else null;
}
+fn setTermVWeight(terms: *[MAX_TERMS]?*Term, id: usize, weight: f32) void {
+ if (terms[id]) |t| t.vweight = weight;
+}
+
// `alloc` must be a per-frame arena, NOT freed before vx.render(): vaxis is a
// retained renderer and stores each cell's grapheme as a *slice* into the text
// we hand it, so plainString has to outlive the render call.
@@ -3019,7 +3023,7 @@ pub fn main(init: std.process.Init) !void {
}
},
.move => |d| {
- moveTerm(&layout, &rects, &col_x, &col_w, d.id, d.cur_x, d.cur_y);
+ moveTerm(&layout, &terms, &rects, &col_x, &col_w, d.id, d.cur_x, d.cur_y, setTermVWeight);
// a file moved into the left column evicts a lone unused shell there
if (terms[d.id]) |mt| if (mt.file != null) {
if (layoutFindTerm(&layout, d.id)) |f| if (f.col == 0)