feat: show error and exit Neovim when version is too old

This commit is contained in:
Folke Lemaitre 2023-10-01 14:18:22 +02:00
parent 9935dc3944
commit 2aea5c7210
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -89,6 +89,21 @@ local options
---@param opts? LazyVimConfig
function M.setup(opts)
options = vim.tbl_deep_extend("force", defaults, opts or {})
if vim.fn.has("nvim-0.9.0") == 0 then
vim.api.nvim_echo({
{
"LazyVim requires Neovim >= 0.9.0\n",
"ErrorMsg",
},
{ "Press any key to exit", "MoreMsg" },
}, true, {})
vim.fn.getchar()
vim.cmd([[quit]])
return
end
if not M.has() then
require("lazy.core.util").error(
"**LazyVim** needs **lazy.nvim** version "