fugitive: preserve existing buffer-local integration maps #123
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
barrettruth/diffs.nvim#123
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent tracker: #270
Problem
diffs.nvimFugitive integration maps are configured maps installed in a third-party buffer, so they must not clobber pre-existing buffer-local mappings.This is the same ownership principle already applied to conflict/merge configured maps:
diffs://buffers are plugin-owned and may have default maps;Issue #257 fixed this class for conflict/merge maps through
lua/diffs/keymaps.lua, but Fugitive integration still uses directvim.keymap.set().Relevant existing code
lua/diffs/fugitive.luasetup_keymaps(bufnr, config)directly installsconfig.horizontalandconfig.verticalwithvim.keymap.set().vim.g.diffs.integrations.fugitive = trueasduanddU.lua/diffs/config.luanormalize_integrations()mapsfugitive = trueto{ horizontal = "du", vertical = "dU" }.plugin/diffs.luaFileType fugitive, callsruntime.attach(args.buf)and thenrequire("diffs.fugitive").setup_keymaps(args.buf, fugitive_config).lua/diffs/keymaps.luaDesired behavior
duordU, diffs.nvim must not replace it.du/dU, cleanup must not delete a mapping if another plugin/user replaces it later.horizontal = falseorvertical = falsemust still disable that map.duhorizontal,dUvertical.Implementation guidance
Reuse
lua/diffs/keymaps.luaif possible.If it needs extension:
<Plug>(...)rhs support.Consider adding a small Fugitive-specific registry so repeated
FileType/attach calls do not duplicate ownership state.Acceptance criteria