Open strager opened 2 years ago
Hi @strager,
The rtp
option is only set inside packers compiled file which by default is only sourced after your nvim config is loaded so it basically doesn't take effect till runtime. I work around this by sourcing my packer compiled file manually whilst my init.lua is being loaded.
There is a plan to refactor packer so this is less of an issue but unfortunately there aren't enough contributors/time for the available contributors to implement it yet, hopefully this won't be an issue in the future
I'll note that while @akinsho is correct about when the rtp
setting is sourced (and its as-soon-as-I-have-time solution...), we could partially fix this bug by checking if paths are files or directories before we try to source
them.
nvim --version
: v0.5.0git --version
: 2.29.2Summary
If a Git repository has a
plugin
directory, and within it is a directory with a.vim
suffix,:PackerSync
tries to:source
the directory. This happens even when using thertp
setting. It looks likertp
is ignored by:PackerSync
's:source
ing.Example plugin repo demonstrating the issue: https://github.com/strager/packer-nvim-bug
Steps to reproduce
Register this repo with packer.nvim with an runtimepath of
plugin/myplugin.vim
: https://github.com/strager/packer-nvim-bugThen, restart Neovim and run
:PackerSync
.Actual behaviour
Installation reports an error:
:messages
shows more details:However, the plugin does seem to be installed. Running
:call myplugin#hello()
printshello world
.Expected behaviour
Installation succeeds without error. Running
:call myplugin#hello()
printshello world
.packer files
Plugin specification file(s)
``` vim.cmd [[packadd packer.nvim]] return require('packer').startup(function() use 'w0rp/ale' use {'strager/packer-nvim-bug', rtp = 'plugin/myplugin.vim'} end) ```packer log file
``` [WARN Wed 29 Sep 2021 10:46:41 PM PDT 3.0038481396473e+14] .../site/pack/packer/start/packer.nvim/lua/packer/clean.lua:79: Cleaning cancelled! [WARN Wed 29 Sep 2021 10:48:15 PM PDT 3.0047908623805e+14] .../site/pack/packer/start/packer.nvim/lua/packer/clean.lua:79: Cleaning cancelled! [ERROR Wed 29 Sep 2021 10:48:18 PM PDT 3.0048180506109e+14] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(source):E484: Can't open file /home/strager/.local/share/nvim/site/pack/packer/start/quick-lint-js/plugin/vim/quick-lint-js.vim [WARN Wed 29 Sep 2021 10:48:52 PM PDT 3.0051635821834e+14] ...ite/pack/packer/start/packer.nvim/lua/packer/display.lua:613: No plugin selected! [WARN Wed 29 Sep 2021 10:52:04 PM PDT 3.0070786254814e+14] .../site/pack/packer/start/packer.nvim/lua/packer/clean.lua:79: Cleaning cancelled! [ERROR Wed 29 Sep 2021 10:52:07 PM PDT 3.0071082514389e+14] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(source):E484: Can't open file /home/strager/.local/share/nvim/site/pack/packer/start/taco/plugin/vim/quick-lint-js.vim [WARN Wed 29 Sep 2021 10:59:33 PM PDT 3.0115706422367e+14] .../site/pack/packer/start/packer.nvim/lua/packer/clean.lua:79: Cleaning cancelled! [ERROR Wed 29 Sep 2021 10:59:35 PM PDT 3.0115942775217e+14] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(source):E484: Can't open file /home/strager/.local/share/nvim/site/pack/packer/start/quick-lint-js/plugin/vim/quick-lint-js.vim [WARN Thu 30 Sep 2021 05:16:37 PM PDT 3.0277473163035e+14] .../site/pack/packer/start/packer.nvim/lua/packer/clean.lua:79: Cleaning cancelled! [WARN Thu 30 Sep 2021 05:17:34 PM PDT 3.02831491865e+14] .../site/pack/packer/start/packer.nvim/lua/packer/clean.lua:79: Cleaning cancelled! [WARN Thu 30 Sep 2021 05:18:37 PM PDT 3.0289436434014e+14] .../site/pack/packer/start/packer.nvim/lua/packer/clean.lua:79: Cleaning cancelled! [ERROR Thu 30 Sep 2021 05:18:37 PM PDT 3.0289439672718e+14] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(source):E484: Can't open file /home/strager/.local/share/nvim/site/pack/packer/start/packer-nvim-bug/plugin/myplugin.vim [WARN Thu 30 Sep 2021 05:29:34 PM PDT 3.0355158242034e+14] .../site/pack/packer/start/packer.nvim/lua/packer/clean.lua:79: Cleaning cancelled! [ERROR Thu 30 Sep 2021 05:29:35 PM PDT 3.0355228077935e+14] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(source):E484: Can't open file /home/strager/.local/share/nvim/site/pack/packer/start/packer-nvim-bug/plugin/myplugin.vim ```packer compiled file
Where is `packer_compiled.vim`? I don't see it in `~/.config/nvim` or in `~/.local/share/nvim`.