From bdf359e2fff285c4b642afcda34ba6b8e833b533 Mon Sep 17 00:00:00 2001 From: jmug Date: Thu, 19 Nov 2026 18:32:18 -0800 Subject: [PATCH] fix: End goes to the end of the current rendered text row. --- kilo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: