From 99e9d3790e14b4272e444a40ec2d5c4a6ffe715d Mon Sep 17 00:00:00 2001 From: borja Date: Mon, 27 Nov 2023 23:52:52 +0100 Subject: [PATCH] =?UTF-8?q?a=20ver=20si=20as=C3=AD=20s=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/todoer.lua | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/plugin/todoer.lua b/plugin/todoer.lua index f5fe3f4..11c131b 100644 --- a/plugin/todoer.lua +++ b/plugin/todoer.lua @@ -64,22 +64,15 @@ local function add_todo() line = "- [ ] " .. line vim.api.nvim_set_current_line(line) elseif index == 1 and spaces > 0 then + local trimedline = string.sub(line, spaces + 1) local spacestring = "" for x = 1, spaces, 1 do spacestring = spacestring .. " " end - line = spacestring .. "- [ ] " .. line + line = spacestring .. "- [ ] " .. trimedline vim.api.nvim_set_current_line(line) end end - -- if not string.sub(line, 1, 1) == " " then - -- line = "- [ ] " .. line - -- vim.api.nvim_set_current_line(line) - -- else - -- line = "- [ ]" .. line - -- vim.api.nvim_set_current_line(line) - -- end - -- end end vim.keymap.set("n", "ta", add_todo, { desc = "Add todo" })