From c99cb844cc7a8a61dbb3b2ea236c190dae561ade Mon Sep 17 00:00:00 2001 From: Atmanand Gauns Date: Thu, 9 Jan 2025 13:39:25 +0530 Subject: [PATCH] fix : task.body lines gettnig duplicated, mentioned in #106 --- src/utils/TaskItemUtils.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/TaskItemUtils.ts b/src/utils/TaskItemUtils.ts index 00eba81..1350248 100644 --- a/src/utils/TaskItemUtils.ts +++ b/src/utils/TaskItemUtils.ts @@ -294,8 +294,13 @@ export const updateTaskInFile = async ( // If task is found, keep adding non-empty lines if (isTaskFound) { - if (!line.startsWith("\t") || !line.startsWith(" ")) break; // Stop at the first empty line - taskLines.push(line); + console.log("updateTaskInFile : Line which is a part of the task :\n", line); + if (line.startsWith("\t") || line.startsWith(" ")) { + taskLines.push(line); + } else { + break; // Stop at the first line which is either empty or doesn't start with a tab + } + } }