nvim-neorocks / rocks.nvim

🌒 Neovim plugin management inspired by Cargo, powered by luarocks
GNU General Public License v3.0
729 stars 15 forks source link

lualine.nvim errors when calling `setup` in `init.lua` #536

Open playa4l opened 2 months ago

playa4l commented 2 months ago

Expected behavior

Lualine is loaded.

Current behavior

Lualine throws an error , doesn't load and the rest of the Neovim files are sourced properly.

Reproducing

  1. Make sure you installed luarocks for your distro.

  2. Get the first init.lua from my Neovim settings.

  3. Open Neovim then run :Rocks! install lualine.nvim | q.

  4. Subsitute the last line (require('init')) with require('lualine').setup({}).

  5. Reopen Neovim.

  6. Open Neovim again.

Additional info

I visited the Lualine GH repo and followed the steps to make an issue, including the part involving making an isolated Neovim settings and, after testing, I reached the conclusion the problem is within rocks.nvim, since the actual setup works as intended in the isolated environment.

mrcjkb commented 2 months ago

Hey :wave:

Thanks for reporting :pray:

mrcjkb commented 2 months ago

Result of my investigation:

This is because lualine uses vim.api.nvim_get_runtime_file instead of package.searchpath to search for its themes, which are in the lua directory. This works if the package is installed with a flat hierarchy (which is how most plugin managers install plugins), but not if it is installed as a luarocks package.

I will look into PRing a fix to lualine.nvim.

In the meantime, there are these workarounds: