diff options
author | kylo252 <[email protected]> | 2022-04-06 16:24:39 +0200 |
---|---|---|
committer | kylo252 <[email protected]> | 2022-04-06 16:24:39 +0200 |
commit | 2d0ba75d036f5c465bd38eb97fc5195d59e6e504 (patch) | |
tree | dbbd3495f7894285a0388fdface0fbedf7973c7a /lua/lvim/utils | |
parent | 23feb96bcc8182f19528298817617336b866eadb (diff) | |
parent | fcb16c0961cd2b6ca522a0b2088ad663fd605b85 (diff) |
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'lua/lvim/utils')
-rw-r--r-- | lua/lvim/utils/git.lua | 18 | ||||
-rw-r--r-- | lua/lvim/utils/hooks.lua | 19 |
2 files changed, 12 insertions, 25 deletions
diff --git a/lua/lvim/utils/git.lua b/lua/lvim/utils/git.lua index ce323160..9848835e 100644 --- a/lua/lvim/utils/git.lua +++ b/lua/lvim/utils/git.lua @@ -113,22 +113,4 @@ function M.get_lvim_current_sha() return abbrev_version end -function M.generate_plugins_sha(output) - local list = {} - output = output or "commits.lua" - - local core_plugins = require "lvim.plugins" - for _, plugin in pairs(core_plugins) do - local name = plugin[1]:match "/(%S*)" - local url = "https://github.com/" .. plugin[1] - print("checking: " .. name .. ", at: " .. url) - local retval, latest_sha = git_cmd { args = { "ls-remote", url, "origin", "HEAD" } } - if retval == 0 then - -- replace dashes, remove postfixes and use lowercase - local normalize_name = (name:gsub("-", "_"):gsub("%.%S+", "")):lower() - list[normalize_name] = latest_sha[1]:gsub("\tHEAD", "") - end - end - require("lvim.utils").write_file(output, "local commit = " .. vim.inspect(list), "w") -end return M diff --git a/lua/lvim/utils/hooks.lua b/lua/lvim/utils/hooks.lua index b40f2c23..932f9c3d 100644 --- a/lua/lvim/utils/hooks.lua +++ b/lua/lvim/utils/hooks.lua @@ -12,17 +12,22 @@ function M.run_pre_reload() end function M.run_on_packer_complete() - if not in_headless then - -- manually trigger event to fix colors - vim.cmd [[ doautocmd ColorScheme ]] + Log:debug "Packer operation complete" + vim.cmd [[doautocmd User PackerComplete]] + + vim.g.colors_name = lvim.colorscheme + pcall(vim.cmd, "colorscheme " .. lvim.colorscheme) + + if M._reload_triggered then + Log:info "Reloaded configuration" + M._reload_triggered = nil end - Log:info "Reloaded configuration" end function M.run_post_reload() Log:debug "Starting post-reload hook" - require("lvim.plugin-loader").ensure_installed() M.reset_cache() + M._reload_triggered = true end ---Reset any startup cache files used by Packer and Impatient @@ -48,8 +53,8 @@ function M.run_post_update() Log:debug "Starting post-update hook" M.reset_cache() - Log:debug "Updating core plugins" - require("lvim.plugin-loader").ensure_installed() + Log:debug "Syncing core plugins" + require("lvim.plugin-loader").sync_core_plugins() if not in_headless then vim.schedule(function() |