From c9a09e591b1f45a9979debaaff26509a89e2bdeb Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 29 Oct 2026 12:22:50 -0300 Subject: the render draws a file body from the geometry its key says is current, not one made again for every frame File.geometry is made by whoever asks first, a step or the frame; the render made it afresh all the same (so that an input its key missed would show only as a headless divergence, never as a stale frame). That cost every scroll a third walk of the body's rows: the step made the map for its ensureCursorVisible, the frame made it again, and the paint walked it. PageDown in the perf harness ran 4% over the base, outside its 2% A/A spread. Drawn from the step's map, a scroll walks the rows twice, as before the geometry was the step's. An input the key misses now shows as a stale frame, which the snapshot goldens catch (all 110 unchanged). Co-Authored-By: Claude Opus 5.5 --- src/body_layer.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/body_layer.zig b/src/body_layer.zig index 5bffb691..5a8d51e5 100644 --- a/src/body_layer.zig +++ b/src/body_layer.zig @@ -170,9 +170,8 @@ pub fn buttonInks(th: *const colors.Theme) [3][3]u8 { /// rail is the grid's alone. pub fn joinBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: Rect, id: usize, active: bool, rail: pardes.Region) !void { if (pane.file == null) return renderBody(p, s, arena, pane, r, id, active, rail, null); - // Made afresh for every frame from the pane as it is, as a step reading - // it would make it (File.geometry): never only by drawing. - pane.geometry_key = 0; + // The pane's geometry as it is (File.geometry): made by the step that + // moved it if one read it, else here, and the same either way. panes.File.geometry(pane); // Which rows are context rows is decided by the text the body shows: a // layer taller than the grid's rows when there are any. -- cgit v1.3