PreTabRenderer

This commit is contained in:
Benjamyn Love 2024-02-08 11:10:29 +11:00
parent 3872447fa2
commit 035dc3dec7

14
kilo.c
View File

@ -355,11 +355,17 @@ void editorMoveCursor(int key)
if (E.cx != 0)
{
E.cx--;
}
} else if (E.cy > 0) {
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) {
E.cy++;
E.cx = 0;
}
break;
@ -378,6 +384,12 @@ void editorMoveCursor(int key)
default:
break;
}
row = (E.cy > E.numrows) ? NULL : &E.row[E.cy];
int rowlen = row ? row->size : 0;
if (E.cx > rowlen) {
E.cx = rowlen;
}
}
void editorProcessKeypress()