Fix firenvim and LeaderF build issues #289
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In lazy.nvim, the
build
parameter accept value in different format. If the value is:
, it will be treated as vim command:
, it will be treated as shell commandI compared closely between case 1 and case 3. In case 1, when lazy.nvim runs the viml command, the runtimepath is already populated with the current plugin we are trying to build.
However in case 3, the runtimepath is not populated with the plugin path, which means that any command you run by this plugin is not available.
So I did it in a hacky way to add the plugin path to runtimepath manually, and source it manually using
:runtime
command. The: runtime
command is needed because in the init process, adding the plugin path to runtimepath does not ensure that the script under this plugin is sourced immediately. So if we want to use the command/function immediately, we need to source it manually, see also neovim/neovim#29957.