chore: bump core-plugins version (#1989)

This commit is contained in:
kylo252 2021-11-27 15:22:43 +01:00 committed by GitHub
parent 044b53a6fe
commit 24be0ef1ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 86 additions and 62 deletions

View file

@ -1,12 +1,12 @@
local plugin_loader = {}
local in_headless = #vim.api.nvim_list_uis() == 0
local utils = require "lvim.utils"
local Log = require "lvim.core.log"
-- we need to reuse this outside of init()
local compile_path = get_config_dir() .. "/plugin/packer_compiled.lua"
local _, packer = pcall(require, "packer")
function plugin_loader.init(opts)
opts = opts or {}
@ -18,10 +18,16 @@ function plugin_loader.init(opts)
vim.cmd "packadd packer.nvim"
end
local log_level = in_headless and "debug" or "warn"
if lvim.log and lvim.log.level then
log_level = lvim.log.level
end
local _, packer = pcall(require, "packer")
packer.init {
package_root = package_root,
compile_path = compile_path,
log = { level = "warn" },
log = { level = log_level },
git = { clone_timeout = 300 },
max_jobs = 50,
display = {
@ -59,6 +65,11 @@ end
function plugin_loader.load(configurations)
Log:debug "loading plugins configuration"
local packer_available, packer = pcall(require, "packer")
if not packer_available then
Log:warn "skipping loading plugins until Packer is installed"
return
end
local status_ok, _ = xpcall(function()
packer.startup(function(use)
for _, plugins in ipairs(configurations) do