Skip to content

Commit ec0efb0

Browse files
authored
fix(#3301): setup with empty config fails (#3303)
1 parent 43a3bb4 commit ec0efb0

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lua/nvim-tree/config.lua

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,13 @@ local function localise_config(d)
504504
end
505505
end
506506

507-
---Normalise the (user) config
508-
---@param u nvim_tree.config
509-
local function process_config(u)
507+
---Normalise the (global) config: defaults and user
508+
---@param g nvim_tree.config
509+
local function process_config(g)
510+
--
510511
-- Open
511-
if u.actions.open_file.window_picker.chars then
512-
u.actions.open_file.window_picker.chars = tostring(u.actions.open_file.window_picker.chars):upper()
513-
end
512+
--
513+
g.actions.open_file.window_picker.chars = tostring(g.actions.open_file.window_picker.chars):upper()
514514
end
515515

516516
---Validate user config and migrate legacy.
@@ -534,10 +534,11 @@ function M.setup(u)
534534

535535
validate_config(u)
536536

537-
process_config(u)
538-
539537
-- set global to the validated and populated user config
540538
M.g = vim.tbl_deep_extend("force", M.d, u)
539+
540+
-- process merged config
541+
process_config(M.g)
541542
end
542543

543544
---Deep clone defaults

0 commit comments

Comments
 (0)