@@ -326,12 +326,12 @@ function OrgAgendaType:render(bufnr, current_line)
326326 return self .view
327327end
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
332332function 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