Skip to content

Commit

Permalink
feat: check if ffi is available and error if not
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 18, 2022
1 parent 0f62ec0 commit c0d3617
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lua/lazy/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ 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 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.fn.has("nvim-0.8.0") ~= 1 then
return vim.notify("lazy.nvim requires Neovim >= 0.8.0", vim.log.levels.ERROR, { title = "lazy.nvim" })
end
if not pcall(require, "ffi") then
return vim.notify("lazy.nvim requires Neovim built with LuaJIT", vim.log.levels.ERROR, { title = "lazy.nvim" })
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
return vim.notify(
"Re-sourcing your config is not supported with lazy.nvim",
vim.log.levels.WARN,
{ title = "lazy.nvim" }
)
end

vim.g.lazy_did_setup = true
local start = vim.loop.hrtime()

Expand Down

0 comments on commit c0d3617

Please sign in to comment.