fix: don't attempt to render off the bottom of the screen

This commit is contained in:
CJ van den Berg 2025-01-03 19:56:15 +01:00
parent 01ce0eb472
commit 5a34a7ead7
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -882,7 +882,8 @@ pub const Editor = struct {
ctx.y += 1;
ctx.x = 0;
ctx.leading = true;
n.cursor_move_yx(@intCast(ctx.y), @intCast(ctx.x)) catch {};
if (ctx.y >= view.rows) return Buffer.Walker.stop;
n.cursor_move_yx(@intCast(ctx.y), @intCast(ctx.x)) catch return Buffer.Walker.stop;
}
return Buffer.Walker.keep_walking;
}