Skip to content

Commit 08f2f31

Browse files
authored
Merge pull request #15 from YoginAlex/fix/checkhealth
fix: checkhealth for neovim 0.5
2 parents f3119d7 + 994194e commit 08f2f31

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lua/battery/health/health.lua

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
local M = {}
2-
local health = require("health")
2+
3+
local start = vim.health.start or vim.health.report_start
4+
local ok = vim.health.ok or vim.health.report_ok
5+
local error = vim.health.error or vim.health.report_error
36

47
-- TODO should check if the plugin is initialized and the setup is valid
58
-- TODO should check what method is being used for battery information
@@ -9,12 +12,12 @@ local function check_setup()
912
end
1013

1114
M.check = function()
12-
health.report_start("battery report")
15+
start("battery report")
1316
-- make sure setup function parameters are ok
1417
if check_setup() then
15-
health.report_ok("Setup function is correct")
18+
ok("Setup function is correct")
1619
else
17-
health.report_error("Setup function is incorrect")
20+
error("Setup function is incorrect")
1821
end
1922
-- do some more checking
2023
-- ...

0 commit comments

Comments
 (0)