Skip to content

Commit cb74f19

Browse files
committed
Add basic checkhealth support
Neovim can use this API to report errors to the user.
1 parent 2c88f0b commit cb74f19

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lua/tpipeline/health.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
local M = {}
2+
3+
M.check = function()
4+
vim.health.report_start("tpipeline report")
5+
local info = vim.fn['tpipeline#debug#info']()
6+
7+
ver = vim.version()
8+
if vim.version.lt(ver, {0, 6, 0}) then
9+
vim.health.report_error(string.format("Neovim version %d.%d is not supported, use 0.6 or higher", ver.major, ver.minor))
10+
else
11+
vim.health.report_ok("Neovim version is supported")
12+
end
13+
end
14+
15+
return M

0 commit comments

Comments
 (0)