small fix where cursor was going over line len

This commit is contained in:
SuperNovaa41 2025-01-17 17:40:59 -05:00
parent f6db66051a
commit d6623447cd

View File

@ -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++;