From 52dac28bcd63166e529fde8090759cafee513ee5 Mon Sep 17 00:00:00 2001 From: Milkias Yeheyis Date: Sat, 15 Jul 2023 00:30:47 +0300 Subject: [PATCH] fix: make neogit respect user's configuration of diffview mentioned in #550 --- lua/neogit/integrations/diffview.lua | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lua/neogit/integrations/diffview.lua b/lua/neogit/integrations/diffview.lua index 34636d7ee..e6f45d97e 100644 --- a/lua/neogit/integrations/diffview.lua +++ b/lua/neogit/integrations/diffview.lua @@ -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"), - [""] = cb("close"), - }, - file_panel = { - ["q"] = cb("close"), - [""] = cb("close"), - }, - }, - }) + local config = dv_config.get_config() + + local view_maps = { + ["q"] = cb("close"), + [""] = cb("close"), + } + local file_panel_maps = { + ["q"] = cb("close"), + [""] = 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)