PreTabRenderer
This commit is contained in:
parent
3872447fa2
commit
035dc3dec7
12
kilo.c
12
kilo.c
@ -355,11 +355,17 @@ void editorMoveCursor(int key)
|
|||||||
if (E.cx != 0)
|
if (E.cx != 0)
|
||||||
{
|
{
|
||||||
E.cx--;
|
E.cx--;
|
||||||
|
} else if (E.cy > 0) {
|
||||||
|
E.cy--;
|
||||||
|
E.cx = E.row[E.cy].size;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ARROW_RIGHT:
|
case ARROW_RIGHT:
|
||||||
if (row && E.cx < row->size) {
|
if (row && E.cx < row->size) {
|
||||||
E.cx++;
|
E.cx++;
|
||||||
|
} else if (row && E.cx == row->size) {
|
||||||
|
E.cy++;
|
||||||
|
E.cx = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -378,6 +384,12 @@ void editorMoveCursor(int key)
|
|||||||
default:
|
default:
|
||||||
break;
|
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()
|
void editorProcessKeypress()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user