mirror of
https://github.com/neovim/neovim.git
synced 2026-01-06 13:27:43 +00:00
fix(checkhealth): skip vim.health #18816
Problem: https://github.com/neovim/neovim/pull/18720#issuecomment-1142614996 The vim.health module is detected as a healthcheck, which produces spurious errors: vim: require("vim.health").check() ======================================================================== - ERROR: Failed to run healthcheck for "vim" plugin. Exception: function health#check, line 20 Vim(eval):E5108: Error executing lua [string "luaeval()"]:1: attempt to call field 'check' (a nil value) stack traceback: [string "luaeval()"]:1: in main chunk Solution: Skip vim.health when discovering healthchecks.
This commit is contained in:
@@ -171,6 +171,11 @@ function! s:get_healthcheck(plugin_names) abort
|
||||
for v in values(healthchecks)
|
||||
let output[v[0]] = v[1:]
|
||||
endfor
|
||||
try
|
||||
" vim.health is not a healthcheck, skip it
|
||||
call remove(output, 'vim')
|
||||
catch
|
||||
endtry
|
||||
return output
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ M._complete = function()
|
||||
vim.tbl_map(function(f)
|
||||
unique[f] = true
|
||||
end, names)
|
||||
-- vim.health is this file, which is not a healthcheck
|
||||
unique['vim'] = nil
|
||||
return vim.tbl_keys(unique)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user