|
|
@ -64,22 +64,15 @@ local function add_todo()
|
|
|
|
line = "- [ ] " .. line
|
|
|
|
line = "- [ ] " .. line
|
|
|
|
vim.api.nvim_set_current_line(line)
|
|
|
|
vim.api.nvim_set_current_line(line)
|
|
|
|
elseif index == 1 and spaces > 0 then
|
|
|
|
elseif index == 1 and spaces > 0 then
|
|
|
|
|
|
|
|
local trimedline = string.sub(line, spaces + 1)
|
|
|
|
local spacestring = ""
|
|
|
|
local spacestring = ""
|
|
|
|
for x = 1, spaces, 1 do
|
|
|
|
for x = 1, spaces, 1 do
|
|
|
|
spacestring = spacestring .. " "
|
|
|
|
spacestring = spacestring .. " "
|
|
|
|
end
|
|
|
|
end
|
|
|
|
line = spacestring .. "- [ ] " .. line
|
|
|
|
line = spacestring .. "- [ ] " .. trimedline
|
|
|
|
vim.api.nvim_set_current_line(line)
|
|
|
|
vim.api.nvim_set_current_line(line)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
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
|
|
|
|
end
|
|
|
|
vim.keymap.set("n", "<leader>ta", add_todo, { desc = "Add todo" })
|
|
|
|
vim.keymap.set("n", "<leader>ta", add_todo, { desc = "Add todo" })
|
|
|
|
|
|
|
|
|
|
|
|