diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..416b2a2 --- /dev/null +++ b/TODO.md @@ -0,0 +1,4 @@ +# TODO + +- [ ] Fix press_enter when line is indented + diff --git a/plugin/todoer.lua b/plugin/todoer.lua index 0d0827b..fa5906f 100644 --- a/plugin/todoer.lua +++ b/plugin/todoer.lua @@ -30,10 +30,10 @@ vim.keymap.set("i", "", press_enter, { desc = "On enter", noremap = true, ex -- function that checks if the current line starts with the string "- [ ]" or "- [x]" and toggles the x local function toggle_todo() - local openpattern = "^%s*%- %[[ ]%]" - local closedpattern = "^%s*%- %[[x]%]" - local titleopenpattern = "^%s*# %[[ ]%]" - local titleclosedpattern = "^%s*# %[[x]%]" + local openpattern = "%- %[[ ]%]" + local closedpattern = "%- %[[x]%]" + local titleopenpattern = "# %[[ ]%]" + local titleclosedpattern = "# %[[x]%]" local line = vim.api.nvim_get_current_line()