mirror of
https://github.com/neovim/neovim.git
synced 2025-12-11 17:12:40 +00:00
fix(pack)!: make default opts.load in add() to work inside 'plugin/'
Problem: Plain `vim.pack.add()` calls (with default `opts.load`) does not fully work if called inside 'plugin/' runtime directory. In particular, 'plugin/' files of newly added plugins are not sourced. This is because `opts.load` is `false` during the whole startup, which means `:packadd!` is used (modify 'runtimepath' but not force source newly added 'plugin/' files). This use case is common due to users organizing their config as separate files in '~/.config/nvim/plugin/'. Solution: Use newly added `v:vim_did_init` to decide default `opts.load` value instead of `v:vim_did_enter`.
This commit is contained in:
@@ -379,7 +379,7 @@ add({specs}, {opts}) *vim.pack.add()*
|
||||
Load `plugin/` files and `ftdetect/` scripts. If `false`,
|
||||
works like `:packadd!`. If function, called with plugin
|
||||
data and is fully responsible for loading plugin. Default
|
||||
`false` during startup and `true` afterwards.
|
||||
`false` during |init.lua| sourcing and `true` afterwards.
|
||||
• {confirm}? (`boolean`) Whether to ask user to confirm
|
||||
initial install. Default `true`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user