|
|
|
@ -4,6 +4,8 @@ vim.keymap.set("n", "<leader>t", function() end, { desc = "+Todos" })
|
|
|
|
|
|
|
|
|
|
local function press_enter()
|
|
|
|
|
local current_line = vim.api.nvim_get_current_line()
|
|
|
|
|
local index, spaces = string.find(current_line, "^%s*")
|
|
|
|
|
|
|
|
|
|
-- Check if the current line matches the pattern
|
|
|
|
|
local pattern = "^%- %[[ x]%] .*$"
|
|
|
|
|
local match = string.match(current_line, pattern)
|
|
|
|
@ -63,6 +65,7 @@ local function add_todo()
|
|
|
|
|
if index == 1 and spaces == 0 then
|
|
|
|
|
line = "- [ ] " .. line
|
|
|
|
|
vim.api.nvim_set_current_line(line)
|
|
|
|
|
vim.api.nvim_feedkeys("A", "n", true)
|
|
|
|
|
elseif index == 1 and spaces > 0 then
|
|
|
|
|
local trimedline = string.sub(line, spaces + 1)
|
|
|
|
|
local spacestring = ""
|
|
|
|
|