fix: rollback plugin loader changes (#3402)

This commit is contained in:
Christian Chiarulli 2022-11-02 18:09:35 -04:00 committed by GitHub
parent f6e5dc0d44
commit 531ddb459e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 103 additions and 40 deletions

View file

@ -2,7 +2,6 @@ local M = {}
local Log = require "lvim.core.log"
local in_headless = #vim.api.nvim_list_uis() == 0
local plugin_loader = require "lvim.plugin-loader"
function M.run_pre_update()
Log:debug "Starting pre-update hook"
@ -16,14 +15,10 @@ function M.run_on_packer_complete()
Log:debug "Packer operation complete"
vim.api.nvim_exec_autocmds("User", { pattern = "PackerComplete" })
vim.g.colors_name = lvim.colorscheme
pcall(vim.cmd, "colorscheme " .. lvim.colorscheme)
if M._reload_triggered then
if not in_headless then
vim.schedule(function()
-- FIXME(kylo252): nvim-tree.lua/lua/nvim-tree/view.lua:442: Invalid window id
-- pcall(vim.api.nvim_exec_autocmds, "ColorScheme", { pattern = "*" })
pcall(vim.cmd.colorscheme, lvim.colorscheme)
end)
end
Log:debug "Reloaded configuration"
M._reload_triggered = nil
end
@ -39,7 +34,7 @@ end
---It also forces regenerating any template ftplugin files
---Tip: Useful for clearing any outdated settings
function M.reset_cache()
plugin_loader.recompile()
vim.cmd [[LuaCacheClear]]
local lvim_modules = {}
for module, _ in pairs(package.loaded) do
if module:match "lvim.core" or module:match "lvim.lsp" then
@ -73,7 +68,7 @@ function M.run_post_update()
M.reset_cache()
Log:debug "Syncing core plugins"
plugin_loader.sync_core_plugins()
require("lvim.plugin-loader").sync_core_plugins()
if not in_headless then
vim.schedule(function()