refactor(conflict): keep default virtual text labels minimal
Problem: default labels included keymap hints ("current — doo") which
is an anti-pattern for a vim plugin — discoverability belongs in docs
and opt-in config, not baked into the default UI.
Solution: default labels return to plain "(current)" / "(incoming)".
Keymap hints are only shown when users provide a format_virtual_text
function or enable show_actions.
This commit is contained in:
parent
c9e2722d19
commit
861f83600a
3 changed files with 7 additions and 41 deletions
|
|
@ -96,15 +96,11 @@ end
|
|||
---@param config diffs.ConflictConfig
|
||||
---@return string?
|
||||
local function get_virtual_text_label(side, config)
|
||||
local keymap = side == 'ours' and config.keymaps.ours or config.keymaps.theirs
|
||||
if config.format_virtual_text then
|
||||
local keymap = side == 'ours' and config.keymaps.ours or config.keymaps.theirs
|
||||
return config.format_virtual_text(side, keymap)
|
||||
end
|
||||
local label = side == 'ours' and 'current' or 'incoming'
|
||||
if keymap then
|
||||
return ('%s \226\128\148 %s'):format(label, keymap)
|
||||
end
|
||||
return label
|
||||
return side == 'ours' and 'current' or 'incoming'
|
||||
end
|
||||
|
||||
---@param bufnr integer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue