cambia el patter de toggle todo para que no pille todos los espacios del principio y así mantenga el indentado cuando hace los cambios

main
borja 1 year ago
parent 1fa6f9048c
commit 4c8b17569e

@ -0,0 +1,4 @@
# TODO
- [ ] Fix press_enter when line is indented

@ -30,10 +30,10 @@ vim.keymap.set("i", "<CR>", 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 -- function that checks if the current line starts with the string "- [ ]" or "- [x]" and toggles the x
local function toggle_todo() local function toggle_todo()
local openpattern = "^%s*%- %[[ ]%]" local openpattern = "%- %[[ ]%]"
local closedpattern = "^%s*%- %[[x]%]" local closedpattern = "%- %[[x]%]"
local titleopenpattern = "^%s*# %[[ ]%]" local titleopenpattern = "# %[[ ]%]"
local titleclosedpattern = "^%s*# %[[x]%]" local titleclosedpattern = "# %[[x]%]"
local line = vim.api.nvim_get_current_line() local line = vim.api.nvim_get_current_line()

Loading…
Cancel
Save