fix(keybinds): handle if keybindings are set to true

This commit is contained in:
Brage Ingebrigtsen 2025-10-22 13:51:13 +02:00
commit b815adc8a0

View file

@ -447,6 +447,24 @@ end
--- Setup the plugin with user configuration --- Setup the plugin with user configuration
--- @param user_config? table User configuration table --- @param user_config? table User configuration table
M.setup = function(user_config) M.setup = function(user_config)
if user_config and user_config.keybindings == true then
user_config.keybindings = nil
end
local function check_bind(command)
---@diagnostic disable-next-line: need-check-nil
if user_config.keybindings[command] == true then
---@diagnostic disable-next-line: need-check-nil
user_config.keybindings[command] = nil
end
end
if user_config and user_config.keybindings then
for k, _ in pairs(user_config.keybindings) do
check_bind(k)
end
end
M.config = vim.tbl_deep_extend("force", { M.config = vim.tbl_deep_extend("force", {
bin = "direnv", bin = "direnv",
autoload_direnv = false, autoload_direnv = false,