From d6623447cd4c466558c595e5be13d0a38566c8ab Mon Sep 17 00:00:00 2001 From: SuperNovaa41 Date: Fri, 17 Jan 2025 17:40:59 -0500 Subject: [PATCH] small fix where cursor was going over line len --- src/controls.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controls.c b/src/controls.c index 14ecccc..4051524 100644 --- a/src/controls.c +++ b/src/controls.c @@ -81,6 +81,10 @@ void do_falldown(row_t* row) * rows, and that len isn't properly being translated * * check this, if i can't figure it out maybe try valgrind to track everything + * + * also try going back a few commits to see where the regression began + * + * consider setting up a test suite */ void move_cursor(movement_t dir) @@ -94,7 +98,7 @@ void move_cursor(movement_t dir) break; case RIGHT: if (editor.cx + 1 > editor.rows[editor.ry - 1].len - && editor.cx + 1 > editor.screen_cols) + || editor.cx + 1 > editor.screen_cols) break; move_cursor_pos(++editor.cx, editor.cy); editor.rx++;