From dd7b7a4b8f79c17c55bddd2e32f46bfd0513284f Mon Sep 17 00:00:00 2001 From: SuperNovaa41 Date: Wed, 15 Jan 2025 17:56:09 -0500 Subject: [PATCH] small fix --- src/controls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controls.c b/src/controls.c index 07feb7f..477e724 100644 --- a/src/controls.c +++ b/src/controls.c @@ -76,7 +76,8 @@ void move_cursor(movement_t dir) editor.rx--; break; case RIGHT: - if (editor.cx + 1 > editor.rows[editor.cy - 1].len) + if (editor.cx + 1 > editor.rows[editor.cy - 1].len + && editor.cx + 1 > editor.screen_cols) break; move_cursor_pos(++editor.cx, editor.cy); editor.rx++;