We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ea05a3 commit a450ae8Copy full SHA for a450ae8
lua/obsidian/util.lua
@@ -478,7 +478,9 @@ end
478
util.toggle_checkbox = function()
479
local line_num = unpack(vim.api.nvim_win_get_cursor(0)) -- 1-indexed
480
local line = vim.api.nvim_get_current_line()
481
- if string.match(line, "^%s*- %[ %].*") then
+ if not string.match(line, "^%s*- %[.*") then
482
+ line = string.gsub(line, "^([ ]*)", "%1- [ ] ")
483
+ elseif string.match(line, "^%s*- %[ %].*") then
484
line = util.string_replace(line, "- [ ]", "- [x]", 1)
485
else
486
for check_char in iter { "x", "~", ">", "-" } do
0 commit comments