Skip to content

Commit

Permalink
fix : task.body lines gettnig duplicated, mentioned in #106
Browse files Browse the repository at this point in the history
  • Loading branch information
tu2-atmanand committed Jan 9, 2025
1 parent b4973b2 commit c99cb84
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils/TaskItemUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

}
}

Expand Down

0 comments on commit c99cb84

Please sign in to comment.