mirror of https://github.com/folke/lazy.nvim.git
feat: added checks for Neovim version
This commit is contained in:
parent
675dece832
commit
72f64ce1f7
|
@ -113,6 +113,9 @@ function M.setup(spec, opts)
|
|||
}
|
||||
end
|
||||
|
||||
-- disable plugin loading since we do all of that ourselves
|
||||
vim.go.loadplugins = false
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
once = true,
|
||||
|
|
|
@ -3,11 +3,17 @@ local M = {}
|
|||
---@param spec LazySpec Should be a module name to load, or a plugin spec
|
||||
---@param opts? LazyConfig
|
||||
function M.setup(spec, opts)
|
||||
if not vim.go.loadplugins or vim.g.lazy_did_setup then
|
||||
if vim.fn.has("nvim-0.8.0") ~= 1 then
|
||||
vim.notify("lazy.nvim requires Neovim >= 0.8.0", vim.log.levels.ERROR, { title = "lazy.nvim" })
|
||||
return
|
||||
end
|
||||
if not vim.go.loadplugins then
|
||||
return
|
||||
end
|
||||
if vim.g.lazy_did_setup then
|
||||
vim.notify("Re-sourcing your config is not supported with lazy.nvim", vim.log.levels.WARN, { title = "lazy.nvim" })
|
||||
return
|
||||
end
|
||||
vim.go.loadplugins = false
|
||||
|
||||
vim.g.lazy_did_setup = true
|
||||
local start = vim.loop.hrtime()
|
||||
|
|
Loading…
Reference in New Issue