Skip to content

Commit b7bcb90

Browse files
feat(agenda): use todo hl group for range grid
1 parent 0312641 commit b7bcb90

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/orgmode/agenda/types/agenda.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,12 @@ function OrgAgendaType:render(bufnr, current_line)
326326
return self.view
327327
end
328328

329-
---@param grid_line { real_date: OrgDate, is_same_day: boolean, is_now: boolean, is_placeholder?: boolean }
329+
---@param grid_line { real_date: OrgDate, is_same_day: boolean, is_now: boolean, is_placeholder?: boolean, hl_group?: string }
330330
---@param agenda_day OrgAgendaDay
331331
---@return OrgAgendaLine
332332
function OrgAgendaType:_build_time_grid_line(grid_line, agenda_day)
333333
local line = AgendaLine:new({
334-
hl_group = '@org.agenda.time_grid',
334+
hl_group = grid_line.hl_group or '@org.agenda.time_grid',
335335
metadata = {
336336
date = grid_line.real_date,
337337
},
@@ -413,6 +413,7 @@ function OrgAgendaType:_prepare_grid_lines(date_range, agenda_day)
413413
if remove_range_match and agenda_item.real_date:has_time_range() then
414414
table.insert(agenda_items_with_range_time, {
415415
from = agenda_item.real_date,
416+
hl_group = agenda_item:get_hlgroup(),
416417
to = Date.from_timestamp(agenda_item.real_date.timestamp_end),
417418
})
418419
end
@@ -451,6 +452,7 @@ function OrgAgendaType:_prepare_grid_lines(date_range, agenda_day)
451452
is_same_day = true,
452453
is_now = false,
453454
is_placeholder = true,
455+
hl_group = range.hl_group,
454456
})
455457
goto continue
456458
end

0 commit comments

Comments
 (0)