mirror of
https://github.com/opdavies/toggle-checkbox.nvim.git
synced 2025-01-22 11:57:32 +00:00
feat: check and uncheck checkboxes
This commit is contained in:
commit
6151b3c0e2
13
lua/toggle-checkbox.lua
Normal file
13
lua/toggle-checkbox.lua
Normal 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
|
Loading…
Reference in a new issue