Skip to content

#3231 step 3: Move config related code from nvim-tree.lua to config.lua #3256

@alex-courtis

Description

@alex-courtis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions