You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the config hook executed after the Git repo is added to runtimepath and after lazy.nvim executes files in the Git repo which don't belong to the plugin (!).
Bug: Instructions in the docs for setting runtimepath using configadd to runtimepath and don't replace the runtimepath entry.
return {
"quick-lint/quick-lint-js",
tag="3.1.0",
config=function(plugin)
vim.opt.rtp:append(plugin.dir.."/plugin/vim/quick-lint-js.vim")
require("lspconfig/quick_lint_js").setup {}
end
}
Open Neovim. Observe that Neovim exits on startup because lazy.nvim executes <quick-lint-js>/plugin/vim/test.vim which is outside the Vim plugin's directory (<quick-lint-js>/plugin/vim/quick-lint-js.vim).
Expected Behavior
Neovim doesn't exit on startup. The quick-lint-js plugin is loaded without error like in other package managers which support an rtp option.
Repro
No response
The text was updated successfully, but these errors were encountered:
I found a hacky workaround. The cond hook executes before anything is added to runtimepath, so I can edit plugin.dir in a cond hook to get the behavior I want:
return {
"quick-lint/quick-lint-js",
tag="3.1.0",
cond=function(plugin)
-- TODO(strager): Don't make this happen multiple times.plugin.dir=plugin.dir.."/plugin/vim/quick-lint-js.vim"returntrueend,
config=function(_plugin)
require("lspconfig/quick_lint_js").setup {}
end,
}
(This workaround probably breaks upgrading and some other flows. I haven't tested it well.)
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.9.5
Operating system/version
macOS 14.2.1
Describe the bug
A plugin exists inside a Git repo. The plugin isn't at the root of the Git repo; it's in the
plugin/vim/quick-lint-js.vim
subdirectory.Following the docs, it looks like I should use the
config
hook: https://github.com/folke/lazy.nvim/tree/main?tab=readme-ov-file#-migration-guideHowever, the
config
hook executed after the Git repo is added to runtimepath and after lazy.nvim executes files in the Git repo which don't belong to the plugin (!).config
add to runtimepath and don't replace the runtimepath entry.:qall!
, causing Neovim to exit on startup. Adding quick-lint-js to my LazyVim config causes vim to stop working. quick-lint/quick-lint-js#1195)Steps To Reproduce
Create
~/.config/nvim/lua/plugins/quick-lint-js.lua
:Open Neovim. Observe that Neovim exits on startup because lazy.nvim executes
<quick-lint-js>/plugin/vim/test.vim
which is outside the Vim plugin's directory (<quick-lint-js>/plugin/vim/quick-lint-js.vim
).Expected Behavior
Neovim doesn't exit on startup. The quick-lint-js plugin is loaded without error like in other package managers which support an
rtp
option.Repro
No response
The text was updated successfully, but these errors were encountered: