From 078b8efbb69167670786ceba3dc2ecb7bd43342f Mon Sep 17 00:00:00 2001 From: Kyle Loveless Date: Tue, 12 Nov 2024 16:16:04 -0600 Subject: [PATCH] end key to end of line --- main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.ts b/main.ts index c194a2f..5a693eb 100644 --- a/main.ts +++ b/main.ts @@ -360,7 +360,9 @@ function editorProcessKeypress() { break; case EditorKey.END_KEY: - e.cursorX = e.screenCols - 1; + if (e.cursorY < e.numRows) { + e.cursorX = e.row[e.cursorY].length; + } break; case EditorKey.PAGE_UP: