navigator.lua/lua/navigator/lazyloader.lua
Matt Bailey d771df0fa7
Name change lspinstall to nvim-lspinstall in lazy loader (#54)
On a clean install, packer compiles down to:

```lua
  ["nvim-lspinstall"] = {
    loaded = true,
    path = "..."
  },
```

rather than 

```lua
  ["nvim-lspinstall"] = {
    loaded = true,
    path = "..."
  },
```

without this change, I get a (cosmetic) error on every startup like this:

```
Error: attempted to load lspinstall which is not present in plugins table!                                                                                                                                                                                                                  
Error in packer_compiled: ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:13: Error: attempted to load lspinstall which is not present in plugins table!                                                                                                                        
Please check your config for correctness
```
```
2021-09-01 09:00:25 +10:00

32 lines
847 B
Lua

local log = require"navigator.util".log
_LoadedClients = {}
local loader = nil
packer_plugins = packer_plugins or nil -- suppress warnings
-- packer only
if packer_plugins ~= nil then -- packer install
local lazy_plugins = {
["nvim-lspconfig"] = "neovim/nvim-lspconfig",
["guihua.lua"] = "ray-x/guihua.lua"
}
if _NgConfigValues.lspinstall == true then
lazy_plugins["nvim-lspinstall"] = "kabouzeid/nvim-lspinstall"
end
-- packer installed
loader = require"packer".loader
for plugin, url in pairs(lazy_plugins) do
if not packer_plugins[url] or not packer_plugins[url].loaded then
log("loading ", plugin)
loader(plugin)
end
end
if _NgConfigValues.lspinstall == true then
local has_lspinst, lspinst = pcall(require, "lspinstall")
if has_lspinst then
lspinst.setup()
end
end
end