Skip to content

Commit

Permalink
Port away from deprecated health API
Browse files Browse the repository at this point in the history
  • Loading branch information
vimpostor committed Jun 13, 2024
1 parent 5dd3832 commit f59f144
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lua/tpipeline/health.lua
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
local M = {}

M.check = function()
vim.health.report_start("tpipeline report")
vim.health.start("tpipeline report")
local info = vim.fn['tpipeline#debug#info']()

local ver = vim.version()
if vim.version.lt(ver, {0, 6, 0}) then
vim.health.report_error(string.format("Neovim version %d.%d is not supported, use 0.6 or higher", ver.major, ver.minor))
vim.health.error(string.format("Neovim version %d.%d is not supported, use 0.6 or higher", ver.major, ver.minor))
else
vim.health.report_ok("Neovim version is supported")
vim.health.ok("Neovim version is supported")
end

if vim.regex('^run'):match_str(info.job_state) == nil then
vim.health.report_error(string.format("Background job is not running: %s", info.job_state))
vim.health.error(string.format("Background job is not running: %s", info.job_state))
else
vim.health.report_ok("Background job is running")
vim.health.ok("Background job is running")
end

if next(info.job_errors) == nil then
vim.health.report_ok("No job errors reported")
vim.health.ok("No job errors reported")
else
vim.health.report_warn("Job reported errors", info.job_errors)
vim.health.warn("Job reported errors", info.job_errors)
end

if info.bad_colors > 0 then
vim.health.report_warn(string.format("The current colorscheme contains %d highlight groups that don't properly support truecolor.\nThese colors might not render correctly in tmux.\nYou can list them with \":echom tpipeline#debug#get_bad_hl_groups()\".", info.bad_colors))
vim.health.warn(string.format("The current colorscheme contains %d highlight groups that don't properly support truecolor.\nThese colors might not render correctly in tmux.\nYou can list them with \":echom tpipeline#debug#get_bad_hl_groups()\".", info.bad_colors))
else
vim.health.report_ok("Colorscheme has true color support")
vim.health.ok("Colorscheme has true color support")
end
end

Expand Down

0 comments on commit f59f144

Please sign in to comment.