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.
This commit is contained in:
AlexKucera committed 2025-09-26 08:20:00 +02:00
1 parent d7497c1259
commit b8b701d78b
1 file changed
-5
-5
View File
@@ -75,13 +75,8 @@ 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);
}
}
private formatPrompts(prompts: string[]): string {
const timestamp = new Date().toLocaleDateString('en-US', {