From b8b701d78b74efd3f41c9795f9279cae8a53c2f7 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Fri, 26 Sep 2025 08:20:00 +0200 Subject: [PATCH] Simplifies cursor placement after prompt insertion Removes conditional logic for setting the cursor position after inserting a prompt. Now, the cursor is consistently placed at the end of the inserted text, regardless of the previous cursor location. This change ensures consistent behavior and simplifies the code. --- commands/notePrompts.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/commands/notePrompts.ts b/commands/notePrompts.ts index ca09b3a..ee61408 100644 --- a/commands/notePrompts.ts +++ b/commands/notePrompts.ts @@ -75,12 +75,7 @@ export class NotePromptsCommand { const newCursorLine = cursor.line + lines.length - 1; const newCursorCh = lines[lines.length - 1].length; - if (cursor.line === lastLine && !needsNewlineBefore) { - // If we were at the last line and didn't add a newline before, adjust - editor.setCursor(cursor.line, cursor.ch + contentToInsert.length); - } else { - editor.setCursor(newCursorLine, newCursorCh); - } + editor.setCursor(newCursorLine, newCursorCh); } private formatPrompts(prompts: string[]): string {