fix: insert template after cursor line

fix: #1248
This commit is contained in:
windingwind 2025-01-06 00:43:13 +01:00
parent e776bb9b22
commit a144a74356

View File

@ -68,11 +68,12 @@ async function insertTemplateCallback(name: string) {
targetNoteId: targetNoteItem.id, targetNoteId: targetNoteItem.id,
}); });
} }
await addLineToNote( let lineIndex = addon.data.template.picker.data.lineIndex;
targetNoteItem, // Insert to the end of the line
html, if (lineIndex >= 0) {
addon.data.template.picker.data.lineIndex, lineIndex += 1;
); }
await addLineToNote(targetNoteItem, html, lineIndex);
} }
async function createTemplateNoteCallback(name: string) { async function createTemplateNoteCallback(name: string) {