feat(conflict): show branch names in virtual text labels

Problem: virtual text showed generic "current"/"incoming" labels with
no indication of which branch each side came from.

Solution: extract the branch name from the marker line itself
(e.g. <<<<<<< HEAD, >>>>>>> feature) and display as
"HEAD (current)" / "feature (incoming)".
This commit is contained in:
Barrett Ruth 2026-02-07 17:57:53 -05:00
parent 1108c33526
commit bae86c5fd9

View file

@ -108,7 +108,7 @@ local function apply_highlights(bufnr, regions, config)
if config.show_virtual_text then
pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, region.marker_ours, 0, {
virt_text = { { ' current', 'DiffsConflictMarker' } },
virt_text = { { ' (current)', 'DiffsConflictMarker' } },
virt_text_pos = 'eol',
})
end
@ -177,7 +177,7 @@ local function apply_highlights(bufnr, regions, config)
if config.show_virtual_text then
pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, region.marker_theirs, 0, {
virt_text = { { ' incoming', 'DiffsConflictMarker' } },
virt_text = { { ' (incoming)', 'DiffsConflictMarker' } },
virt_text_pos = 'eol',
})
end