diff options
author | kylo252 <[email protected]> | 2021-12-06 17:04:46 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-06 17:04:46 +0100 |
commit | 6770808bec1ffcada425ae514747f9380e3d3b8d (patch) | |
tree | 657712b9a93588b16db9646446089f6f084c9b65 /lua/lvim/utils/hooks.lua | |
parent | 38a172434027c9ac2a71cd658803ec3f7a39ab09 (diff) |
feat: full compatibility with neovim v0.6 (#2037)
Diffstat (limited to 'lua/lvim/utils/hooks.lua')
-rw-r--r-- | lua/lvim/utils/hooks.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lua/lvim/utils/hooks.lua b/lua/lvim/utils/hooks.lua index 0fe4a7fd..1d265482 100644 --- a/lua/lvim/utils/hooks.lua +++ b/lua/lvim/utils/hooks.lua @@ -7,7 +7,9 @@ local in_headless = #vim.api.nvim_list_uis() == 0 function M.run_pre_update() Log:debug "Starting pre-update hook" _G.__luacache.clear_cache() - vim.cmd "LspStop" + if package.loaded["lspconfig"] then + vim.cmd [[ LspStop ]] + end end ---Reset any startup cache files used by Packer and Impatient @@ -34,9 +36,14 @@ function M.run_post_update() if not in_headless then vim.schedule(function() + if package.loaded["nvim-treesitter"] then + vim.cmd [[ TSUpdateSync ]] + end -- TODO: add a changelog vim.notify("Update complete", vim.log.levels.INFO) - vim.cmd "LspRestart" + if package.loaded["lspconfig"] then + vim.cmd [[ LspRestart ]] + end end) end end |