diff --git a/kilo.c b/kilo.c index 6bef035..9a901a3 100644 --- a/kilo.c +++ b/kilo.c @@ -460,7 +460,8 @@ void editorProcessKeypress() { E.cx = 0; break; case END_KEY: - E.cx = E.screencols - 1; + if (E.cy < E.numrows) + E.cx = E.row[E.cy].size; break; case PAGE_UP: