diff --git a/plugin/todoer.lua b/plugin/todoer.lua index 8c8d695..6a0f43f 100644 --- a/plugin/todoer.lua +++ b/plugin/todoer.lua @@ -36,12 +36,10 @@ local function press_tab() local closedpattern = "%- %[[x]%]" if string.match(current_line, openpattern) or string.match(current_line, closedpattern) then - vim.api.nvim_feedkeys(vim.api.nvim_eval('"\\"'), "n", true) vim.api.nvim_feedkeys(">", "n", true) - vim.api.nvim_feedkeys("A", "n", true) end end -vim.keymap.set("i", "", press_tab, { desc = "On tab", noremap = true, expr = true }) +vim.keymap.set("n", "", press_tab, { desc = "On tab", noremap = true, expr = true }) -- function that checks if the current line starts with the string "- [ ]" or "- [x]" and toggles the x