mirror of
https://github.com/zoriya/lz.n.git
synced 2025-12-06 06:36:11 +00:00
feat: deprecate trigger_load with lists of plugin specs
This commit is contained in:
@@ -21,7 +21,7 @@ lz.n Lua API *lz.n.api*
|
||||
M.trigger_load() *M.trigger_load*
|
||||
The function provides two overloads, each suited for different use cases:
|
||||
|
||||
@overload fun(plugins: lz.n.Plugin | string[] | lz.n.Plugin[] | table<unknown, lz.n.Plugin>)
|
||||
@overload fun(plugin: lz.n.Plugin)
|
||||
**Stateless version:**
|
||||
- Intended for: Use by a `lz.n.Handler`
|
||||
- Description: This version should be used when working with `lz.n.Handler`
|
||||
@@ -29,8 +29,13 @@ M.trigger_load() *M.trigger_load*
|
||||
Each handler has full authority over its internal state, ensuring it
|
||||
remains isolated and unaffected by external influences,
|
||||
thereby preventing multiple sources of truth.
|
||||
- Note: If loading multiple plugins simultaneously,
|
||||
handlers should iterate over |vim.deepcopy| of the plugins,
|
||||
verifying they are still pending before each `trigger_load` call.
|
||||
This practice allows for safe invocation of the stateful `trigger_load`
|
||||
in `before` and `after` hooks.
|
||||
|
||||
@overload fun(plugins: string | string[], opts: lz.n.lookup.Opts): string[]
|
||||
@overload fun(plugins: string | string[], opts?: lz.n.lookup.Opts): string[]
|
||||
**Stateful version:**
|
||||
- Returns: A list of plugin names that were skipped
|
||||
(empty if all plugins were loaded).
|
||||
|
||||
Reference in New Issue
Block a user