diff --git a/.gitignore b/.gitignore index 6e92f57..dad0487 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ tags +test.md diff --git a/lua/checkbox.lua b/lua/checkbox.lua index edb3ce9..63080bf 100644 --- a/lua/checkbox.lua +++ b/lua/checkbox.lua @@ -133,10 +133,10 @@ local function findChildren(startCheckbox) if not skipped then return children end - else - if checkbox.indentation > startCheckbox.indentation then - table.insert(children, checkbox) - end + elseif checkbox.indentation == startCheckbox.indentation then + return children + elseif checkbox.indentation > startCheckbox.indentation then + table.insert(children, checkbox) end end return children