From 5a34a7ead744063bd155fef650c3b82c9be06446 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Fri, 3 Jan 2025 19:56:15 +0100 Subject: [PATCH] fix: don't attempt to render off the bottom of the screen --- src/tui/editor.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index fe47e7b..5b9342f 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -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; }