Skip to content

Commit

Permalink
fix(health): remove deprecated api warning (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
escwxyz committed Apr 23, 2023
1 parent b760ec6 commit 4fbb7a2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lua/lazyvim/health.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
local M = {}

local start = vim.health.start or vim.health.report_start
local ok = vim.health.ok or vim.health.report_ok
local warn = vim.health.warn or vim.health.report_warn
local error = vim.health.error or vim.health.report_error

function M.check()
vim.health.report_start("LazyVim")
start("LazyVim")

if vim.fn.has("nvim-0.8.0") == 1 then
vim.health.report_ok("Using Neovim >= 0.8.0")
ok("Using Neovim >= 0.8.0")
else
vim.health.report_error("Neovim >= 0.8.0 is required")
error("Neovim >= 0.8.0 is required")
end

for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do
Expand All @@ -23,9 +28,9 @@ function M.check()
end

if found then
vim.health.report_ok(("`%s` is installed"):format(name))
ok(("`%s` is installed"):format(name))
else
vim.health.report_warn(("`%s` is not installed"):format(name))
warn(("`%s` is not installed"):format(name))
end
end
end
Expand Down

0 comments on commit 4fbb7a2

Please sign in to comment.