diff --git a/doc/guard.nvim.txt b/doc/guard.nvim.txt index 7651f66..ec00cb5 100644 --- a/doc/guard.nvim.txt +++ b/doc/guard.nvim.txt @@ -1,4 +1,4 @@ -*guard.nvim.txt* For NVIM v0.8.0 Last change: 2025 June 10 +*guard.nvim.txt* For NVIM v0.8.0 Last change: 2025 June 11 ============================================================================== Table of Contents *guard.nvim-table-of-contents* diff --git a/lua/guard/health.lua b/lua/guard/health.lua index b61287b..d87807d 100644 --- a/lua/guard/health.lua +++ b/lua/guard/health.lua @@ -18,6 +18,7 @@ end local function executable_check() local checked = {} + local custom_checked = {} for ft, item in pairs(filetype) do if ft:find(',') then goto continue @@ -25,15 +26,17 @@ local function executable_check() -- run executable or custom healt check for _, conf in ipairs(item.formatter or {}) do - if conf.health then + if type(conf.health) == 'function' and not vim.tbl_contains(custom_checked, conf.health) then conf.health() + table.insert(custom_checked, conf.health) else check_cmd(conf, checked) end end for _, conf in ipairs(item.linter or {}) do - if conf.health then + if type(conf.health) == 'function' and not vim.tbl_contains(custom_checked, conf.health) then conf.health() + table.insert(custom_checked, conf.health) else check_cmd(conf, checked) end