feat(todo): add onlyTodo option

This commit is contained in:
Thomas Lambert
2022-09-28 22:25:51 +02:00
parent 31af52ed76
commit 74636e7416
3 changed files with 40 additions and 27 deletions

View File

@@ -2736,7 +2736,11 @@ local function ToggleTodo(opts)
repline = curline:gsub("%- %[ %]", "- [x]", 1)
else
if vim.startswith(stripped, "- [x]") then
repline = curline:gsub("%- %[x%]", "-", 1)
if opts.onlyTodo then
repline = curline:gsub("%- %[x%]", "- [ ]", 1)
else
repline = curline:gsub("%- %[x%]", "-", 1)
end
else
repline = curline:gsub("(%S)", "- [ ] %1", 1)
end