From 04ac860a8ad1a4f01e4c641e421241b5c818014d Mon Sep 17 00:00:00 2001 From: CaeChao Date: Mon, 8 Apr 2024 22:44:57 -0400 Subject: [PATCH] fix: recover toggle_checkbox util's condition to create a checkbox with a line without a checkbox --- lua/obsidian/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/obsidian/util.lua b/lua/obsidian/util.lua index 1d3138cfd..2d9b96cf8 100644 --- a/lua/obsidian/util.lua +++ b/lua/obsidian/util.lua @@ -506,7 +506,7 @@ util.toggle_checkbox = function(opts) if string.match(line, unordered_list_pattern) then line = string.gsub(line, unordered_list_pattern, "%1- [ ] %2") else - return + line = string.gsub(line, "^(%s*)", "%1- [ ] ") end else for i, check_char in enumerate(checkboxes) do