From 709403ccd6f22d859c2e42c780ab558ae89284d9 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Sat, 9 Nov 2024 22:28:24 -0800 Subject: [PATCH] fix: don't deep merge keymaps (#510) --- lua/oil/config.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/oil/config.lua b/lua/oil/config.lua index 5ccde173..2505c3e2 100644 --- a/lua/oil/config.lua +++ b/lua/oil/config.lua @@ -355,9 +355,16 @@ local M = {} ---@field border? string|string[] Window border M.setup = function(opts) - local new_conf = vim.tbl_deep_extend("keep", opts or {}, default_config) + opts = opts or {} + local new_conf = vim.tbl_deep_extend("keep", opts, default_config) if not new_conf.use_default_keymaps then new_conf.keymaps = opts.keymaps or {} + else + -- We don't want to deep merge the keymaps, we want any keymap defined by the user to override + -- everything about the default. + for k, v in pairs(opts.keymaps) do + new_conf.keymaps[k] = v + end end if new_conf.lsp_rename_autosave ~= nil then