From 1f3629d6d7e9aab70930183d58a58df0f68448f5 Mon Sep 17 00:00:00 2001 From: Avery Terrel Date: Tue, 18 Aug 2026 02:28:49 -0500 Subject: [PATCH] vi: fix KEY_END placing cursor at last written character in insert mode Signed-off-by: Avery Terrel --- toys/pending/vi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toys/pending/vi.c b/toys/pending/vi.c index be8df42b..9a2b9644 100644 --- a/toys/pending/vi.c +++ b/toys/pending/vi.c @@ -1051,7 +1051,8 @@ static int vi_dollar(int count0, int count1, char *unused) size_t new = text_strchr(TT.cursor, '\n'); if (new != TT.cursor) { - TT.cursor = new - 1; + TT.cursor = new; + if (TT.vi_mode != 2) TT.cursor--; TT.vi_mov_flag |= 2; check_cursor_bounds(); } -- 2.39.5