refactor: rewrite perl provider in lua

This commit is contained in:
dundargoc
2024-01-22 22:07:14 +01:00
committed by dundargoc
parent 8c044f0862
commit 576db141be
4 changed files with 88 additions and 88 deletions

View File

@@ -9,19 +9,14 @@ function M.check()
return
end
local perl_detect_table = vim.fn['provider#perl#Detect']()
local perl_exec = perl_detect_table[1]
local perl_warnings = perl_detect_table[2]
local perl_exec, perl_warnings = require('vim.provider.perl').detect()
if perl_exec:find('^%s*$') then
if perl_warnings:find('%S') then
health.warn(perl_warnings, {
'See :help provider-perl for more information.',
'You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim',
})
else
health.warn('No usable perl executable found')
end
if not perl_exec then
health.warn(assert(perl_warnings), {
'See :help provider-perl for more information.',
'You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim',
})
health.warn('No usable perl executable found')
return
end