From 4c8b17569e3c3a785627d426e22a90937e22d946 Mon Sep 17 00:00:00 2001 From: borja Date: Wed, 29 Nov 2023 09:14:26 +0100 Subject: [PATCH] =?UTF-8?q?cambia=20el=20patter=20de=20toggle=20todo=20par?= =?UTF-8?q?a=20que=20no=20pille=20todos=20los=20espacios=20del=20principio?= =?UTF-8?q?=20y=20as=C3=AD=20mantenga=20el=20indentado=20cuando=20hace=20l?= =?UTF-8?q?os=20cambios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TODO.md | 4 ++++ plugin/todoer.lua | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 TODO.md 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()