Skip to main content

build_and_format

Function build_and_format 

Source
pub fn build_and_format(
    workdir: &PathBuf,
    expanded: &HashSet<String>,
    context: i64,
    lang_registry: Option<&Arc<LangRegistry>>,
) -> (String, Vec<Vec<StyledSpan>>, Vec<Field>, HashMap<String, usize>, Vec<Vec<RefineSpan>>)
Expand description

Build the status buffer text (+ styled spans + MG.14 header fields) from live git data. Blocking — call on spawn_blocking.

The header comes out of the SAME SectionIndex the body is formatted from — branch, ahead/behind, and the per-section counts are all already in hand — so surfacing it costs no extra git call. (Before MG.14 the index’s branch/ahead/behind were computed on every refresh and thrown away: SectionIndex::branch_status_line was written to render them and never called from anywhere.)