feat: automatically create subtask relations based on indention #2443

Merged
konrad merged 6 commits from feature/subtask-via-indention into main 2022-09-30 11:47:22 +00:00
1 changed files with 5 additions and 1 deletions
Showing only changes of commit d58f8b4ba1 - Show all commits

View File

@ -20,10 +20,14 @@ export function parseSubtasksViaIndention(taskTitles: string): TaskWithParent[]
parent: null,
}
if (index === 0) {
konrad marked this conversation as resolved Outdated

Move matched and matchedSpaces in condition aswell since it's not used for index === 0

Move `matched` and `matchedSpaces` in condition aswell since it's not used for `index === 0`

Added an earlier break for index === 0.

Added an earlier break for `index === 0`.
return task
}
const matched = spaceRegex.exec(title)
const matchedSpaces = matched ? matched[0].length : 0
if (matchedSpaces > 0 && index > 0) {
if (matchedSpaces > 0) {
// Go up the tree to find the first task with less indention than the current one
let pi = 1
let parentSpaces = 0