From ac03e408f8d63ffe878eba2338a954db00e0ca36 Mon Sep 17 00:00:00 2001 From: borja Date: Mon, 27 Nov 2023 23:36:56 +0100 Subject: [PATCH] prueba con find --- plugin/todoer.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/todoer.lua b/plugin/todoer.lua index 79556c6..aea0416 100644 --- a/plugin/todoer.lua +++ b/plugin/todoer.lua @@ -57,8 +57,8 @@ local function add_todo() local closedpattern = "^%s*%- %[[x]%]" local line = vim.api.nvim_get_current_line() - local spaces = string.match(line, "^%s*") - print(spaces) + local i, spaces = string.find(line, "^%s*") + print(i, spaces) -- if not string.match(line, openpattern) and not string.match(line, closedpattern) then -- line = spaces .. "- [ ] " .. line