feat: Previous and next line on line limits.
This commit is contained in:
@@ -349,11 +349,17 @@ void editorMoveCursor(int key) {
|
||||
case ARROW_LEFT:
|
||||
if (E.cx != 0) {
|
||||
E.cx--;
|
||||
} else if (E.cy > 0) { // Go to previous line on left at start.
|
||||
E.cy--;
|
||||
E.cx = E.row[E.cy].size;
|
||||
}
|
||||
break;
|
||||
case ARROW_RIGHT:
|
||||
if (row && E.cx < row->size) {
|
||||
E.cx++;
|
||||
} else if (row && E.cx == row->size) { // Go to next line on right at end.
|
||||
E.cy++;
|
||||
E.cx = 0;
|
||||
}
|
||||
break;
|
||||
case ARROW_UP:
|
||||
|
||||
Reference in New Issue
Block a user