Skip to content

Commit

Permalink
feat(health): add compatibility for Neovim 0.10 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
WhoIsSethDaniel authored May 8, 2024
1 parent 0b6ca4e commit 242ee15
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lua/zf-native/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ local health = vim.fn.has('nvim-0.8') and vim.health or require("health")
local telescope = require("telescope")
local zf = require("zf")

local health_start = health.start or health.report_start
local health_error = health.error or health.report_error
local health_warn = health.warn or health.report_warn
local health_info = health.info or health.report_info
local health_ok = health.ok or health.report_ok

local M = {}

M.check = function()
health.report_start("Installation")
health_start("Installation")

local path = zf.get_path()
health.report_info(string.format("libzf library path: %s", path))
health_info(string.format("libzf library path: %s", path))

if vim.fn.filereadable(path) == 0 then
health.report_error("libzf path does not exist")
health_error("libzf path does not exist")
else
health.report_ok("libzf path is valid")
health_ok("libzf path is valid")
end

local configuration = { "Configuration" }
Expand Down Expand Up @@ -44,7 +50,7 @@ M.check = function()
table.insert(configuration, " - zf telescope generic sorter disabled")
end

health.report_start(table.concat(configuration, "\n"))
health_start(table.concat(configuration, "\n"))

end

Expand Down

0 comments on commit 242ee15

Please sign in to comment.