aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/provider/perl/health.lua
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-01-22 22:07:14 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-01-24 11:55:28 +0100
commit576db141be6e4d9b5d9b840c599bac670df25d1a (patch)
tree11bee79aea2c57e875414b2e67f02abc501493d1 /runtime/lua/provider/perl/health.lua
parent8c044f0862f417a525eaf319471c286a5588d493 (diff)
downloadrneovim-576db141be6e4d9b5d9b840c599bac670df25d1a.tar.gz
rneovim-576db141be6e4d9b5d9b840c599bac670df25d1a.tar.bz2
rneovim-576db141be6e4d9b5d9b840c599bac670df25d1a.zip
refactor: rewrite perl provider in lua
Diffstat (limited to 'runtime/lua/provider/perl/health.lua')
-rw-r--r--runtime/lua/provider/perl/health.lua19
1 files changed, 7 insertions, 12 deletions
diff --git a/runtime/lua/provider/perl/health.lua b/runtime/lua/provider/perl/health.lua
index d14ebc97ab..6066c69968 100644
--- a/runtime/lua/provider/perl/health.lua
+++ b/runtime/lua/provider/perl/health.lua
@@ -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