feat: check and uncheck checkboxes

This commit is contained in:
Oliver Davies 2022-08-08 13:58:47 -04:00
commit 6151b3c0e2
2 changed files with 14 additions and 0 deletions

1
init.lua Normal file
View file

@ -0,0 +1 @@
require("toggle-checkbox")

13
lua/toggle-checkbox.lua Normal file
View file

@ -0,0 +1,13 @@
local checked_character = "x"
local M = {}
M.check = function(line)
return line:gsub("%[ %]", "[" .. checked_character .. "]")
end
M.uncheck = function(line)
return line:gsub("%[" .. checked_character .. "%]", "[]")
end
return M