Skip to content

Commit 09d3d87

Browse files
Fix today's date highlighting in calendar. Fixes #93.
1 parent 9125c4d commit 09d3d87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/orgmode/objects/calendar.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ function Calendar.render()
108108
if is_today_month then
109109
local day_formatted = today:format('%d')
110110
for i, line in ipairs(value) do
111-
local from, to = line:find(day_formatted)
111+
local from, to = line:find('%s' .. day_formatted .. '%s')
112112
if from and to then
113-
vim.api.nvim_buf_add_highlight(Calendar.buf, Calendar.namespace, 'OrgCalendarToday', i - 1, from - 2, to + 1)
113+
vim.api.nvim_buf_add_highlight(Calendar.buf, Calendar.namespace, 'OrgCalendarToday', i - 1, from - 1, to)
114114
end
115115
end
116116
end

0 commit comments

Comments
 (0)