small fix

This commit is contained in:
SuperNovaa41 2025-01-15 17:56:09 -05:00
parent f20770693b
commit dd7b7a4b8f

View File

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