Skip to content

Commit

Permalink
fix: make neogit respect user's configuration of diffview
Browse files Browse the repository at this point in the history
mentioned in #550
  • Loading branch information
milkias17 committed Jul 14, 2023
1 parent d00d510 commit 52dac28
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions lua/neogit/integrations/diffview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,19 @@ end
function M.open(section_name, item_name)
old_config = dv_config.get_config()

local config = vim.tbl_deep_extend("force", old_config, {
keymaps = {
view = {
["q"] = cb("close"),
["<esc>"] = cb("close"),
},
file_panel = {
["q"] = cb("close"),
["<esc>"] = cb("close"),
},
},
})
local config = dv_config.get_config()

local view_maps = {
["q"] = cb("close"),
["<esc>"] = cb("close"),
}
local file_panel_maps = {
["q"] = cb("close"),
["<esc>"] = cb("close"),
}

config.keymaps.view = dv_config.extend_keymaps(view_maps, config.keymaps.view or {})
config.keymaps.file_panel = dv_config.extend_keymaps(file_panel_maps, config.keymaps.file_panel or {})

dv.setup(config)

Expand Down

0 comments on commit 52dac28

Please sign in to comment.