From c68d259ec9193e5d3283d3e674d9d61e89f06a71 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Thu, 15 Jun 2023 08:58:47 +0200 Subject: [PATCH] fixed: add events after todo header --- main.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 3188da3..a041394 100644 --- a/main.js +++ b/main.js @@ -1313,8 +1313,15 @@ function checkevents() { showtemporaryinfo("Calendar changes to check"); var todo = getnote("todo"); - var content = todo.content; - todo.content = newcontent.join("\n") + "\n" + content; + var idx = 0; + if (todo.content.startsWith("---")) + { + idx = todo.content.indexOf("---", 3) + 4; + } + todo.content = todo.content.substring(0, idx) + + newcontent.join("\n") + + "\n" + + todo.content.substring(idx); // reload todo if open if (currentnote == todo)