From 4fbb7a280310a6ea500509aa73a4f7c7d06f6bea Mon Sep 17 00:00:00 2001 From: J <124119483+escwxyz@users.noreply.github.com> Date: Sun, 23 Apr 2023 11:04:05 +0200 Subject: [PATCH] fix(health): remove deprecated api warning (#666) --- lua/lazyvim/health.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/health.lua b/lua/lazyvim/health.lua index aca7fa7e..810022e5 100644 --- a/lua/lazyvim/health.lua +++ b/lua/lazyvim/health.lua @@ -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 @@ -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