Skip to content

Commit 72fef86

Browse files
committed
fixup! feature: add support for cookies
1 parent 71880f3 commit 72fef86

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/orgmode/org/syntax.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ local function _display_cookie_virt_text(cookie, checked, total)
5454
if cookie_text == '[/]' then
5555
text = string.format('[%d/%d]', checked, total)
5656
else
57-
text = string.format('[%d%%]', (100 * checked) / total)
57+
if total > 0 then
58+
text = string.format('[%d%%]', (100 * checked) / total)
59+
else
60+
text = '[0%]'
61+
end
5862
end
5963
vim.api.nvim_buf_set_extmark(0, cookie_namespace, row, column + (leading_spaces or 0), {
6064
-- TODO: make highlight group configurable

0 commit comments

Comments
 (0)