@@ -249,6 +249,10 @@ function OrgAgendaType:render(bufnr, current_line)
249249 end
250250 local agenda_days = self :_get_agenda_days ()
251251
252+ local prefix_formats = self .org_agenda_prefix_format or config .org_agenda_prefix_format
253+ local prefix_format = prefix_formats .agenda
254+ local compiled_prefix = Formatter .compile (prefix_format )
255+
252256 local agendaView = AgendaView :new ({ bufnr = self .bufnr , highlighter = self .highlighter })
253257 agendaView :add_line (AgendaLine :single_token ({
254258 content = self :_get_title (),
@@ -272,7 +276,7 @@ function OrgAgendaType:render(bufnr, current_line)
272276 for _ , agenda_item in ipairs (agenda_day .agenda_items ) do
273277 -- If there is an index value, this is an AgendaItem instance
274278 if agenda_item .index then
275- agendaView :add_line (self :_build_line (agenda_item , agenda_day ))
279+ agendaView :add_line (self :_build_line (agenda_item , agenda_day , compiled_prefix ))
276280 else
277281 agendaView :add_line (self :_build_time_grid_line (agenda_item , agenda_day ))
278282 end
499503--- @private
500504--- @param agenda_item OrgAgendaItem
501505--- @param metadata table<string , any>
506+ --- @param compiled_prefix ? OrgAgendaFormatterSegment[]
502507--- @return OrgAgendaLine
503- function OrgAgendaType :_build_line (agenda_item , metadata )
508+ function OrgAgendaType :_build_line (agenda_item , metadata , compiled_prefix )
504509 local headline = agenda_item .headline
505510 local item_hl_group = agenda_item :get_hlgroup ()
506511 local line = AgendaLine :new ({
@@ -515,7 +520,7 @@ function OrgAgendaType:_build_line(agenda_item, metadata)
515520 })
516521
517522 local prefix_formats = self .org_agenda_prefix_format or config .org_agenda_prefix_format
518- local prefix_format = prefix_formats .agenda
523+ local prefix_format = compiled_prefix or Formatter . compile ( prefix_formats .agenda )
519524 local prefix = Formatter .format (prefix_format , agenda_item , metadata )
520525
521526 line :add_token (AgendaLineToken :new ({
0 commit comments