Part of #3231 : Performance: Load Only Necessary Modules On setup and requiring API
Create a new config.lua module containing:
- constants like
DEFAULT_OPTS, ACCEPTED_TYPES
- all validation functionality like
validate_options
- move any config functionality from
M.setup into a function in config.lua that is the single mutation endpoint.
- a getter for the current config with API
nvim_tree.api.config.current() that returns a deep clone
- as above for
default()
Config is referred to as opts/options, which is confusing as opts is used for optional function parameters. Refer to everything as config. Ensure that help and help-update.sh is updated accordingly.
M.config, local _config and M.setup opts must be removed from nvim-tree.lua. Replace them with references to config.lua getter.
Part of #3231 : Performance: Load Only Necessary Modules On setup and requiring API
Create a new
config.luamodule containing:DEFAULT_OPTS,ACCEPTED_TYPESvalidate_optionsM.setupinto a function inconfig.luathat is the single mutation endpoint.nvim_tree.api.config.current()that returns a deep clonedefault()Config is referred to as opts/options, which is confusing as opts is used for optional function parameters. Refer to everything as config. Ensure that help and
help-update.shis updated accordingly.M.config,local _configandM.setupoptsmust be removed fromnvim-tree.lua. Replace them with references toconfig.luagetter.