PreTabRenderer
This commit is contained in:
parent
3872447fa2
commit
035dc3dec7
14
kilo.c
14
kilo.c
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user