diff options
Diffstat (limited to 'main.zig')
| -rw-r--r-- | main.zig | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) |
