Fix health check for nvim 0.7(#13)
This commit is contained in:
parent
08f9156ebc
commit
bb494abd1e
1 changed files with 8 additions and 6 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
|
local health = vim.health or require "health"
|
||||||
local utils = require "gopher._utils"
|
local utils = require "gopher._utils"
|
||||||
local c = require("gopher.config").config.commands
|
local c = require("gopher.config").config.commands
|
||||||
|
|
||||||
local M = {
|
local M = {
|
||||||
_required = {
|
_required = {
|
||||||
plugins = {
|
plugins = {
|
||||||
|
|
@ -16,21 +18,21 @@ local M = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.check()
|
function M.check()
|
||||||
vim.health.report_start "Required plugins"
|
health.report_start "Required plugins"
|
||||||
for _, plugin in ipairs(M._required.plugins) do
|
for _, plugin in ipairs(M._required.plugins) do
|
||||||
if utils.lualib_is_found(plugin.lib) then
|
if utils.lualib_is_found(plugin.lib) then
|
||||||
vim.health.report_ok(plugin.lib .. " installed.")
|
health.report_ok(plugin.lib .. " installed.")
|
||||||
else
|
else
|
||||||
vim.health.report_error(plugin.lib .. " not found. Gopher.nvim will not work without it!")
|
health.report_error(plugin.lib .. " not found. Gopher.nvim will not work without it!")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.health.report_start "Required go tools"
|
health.report_start "Required go tools"
|
||||||
for _, binary in ipairs(M._required.binarys) do
|
for _, binary in ipairs(M._required.binarys) do
|
||||||
if utils.binary_is_found(binary.bin) then
|
if utils.binary_is_found(binary.bin) then
|
||||||
vim.health.report_ok(binary.bin .. " installed")
|
health.report_ok(binary.bin .. " installed")
|
||||||
else
|
else
|
||||||
vim.health.report_warn(binary.bin .. " is not installed but " .. binary.help)
|
health.report_warn(binary.bin .. " is not installed but " .. binary.help)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue