From 78219330f1008cce105cbcde22c6e205786e4c43 Mon Sep 17 00:00:00 2001 From: Samuel Roeca Date: Sat, 14 Oct 2023 02:53:40 -0700 Subject: [PATCH] Fix: deprecation warning for Neovim healthcheck (#610) --- autoload/health/mkdp.vim | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/autoload/health/mkdp.vim b/autoload/health/mkdp.vim index 9eebb560..323b57be 100644 --- a/autoload/health/mkdp.vim +++ b/autoload/health/mkdp.vim @@ -1,19 +1,18 @@ let s:mkdp_root_dir = expand(':h:h:h') function! health#mkdp#check() abort - call health#report_info('Platform: ' . mkdp#util#get_platform()) - let l:info = system('nvim --version') - call health#report_info('Nvim Version: '. split(l:info, '\n')[0]) - let l:mkdp_server_script = s:mkdp_root_dir . '/app/bin/markdown-preview-' . mkdp#util#get_platform() + lua vim.health.info("Platform: " .. vim.fn['mkdp#util#get_platform']()) + lua vim.health.info('Nvim Version: ' .. string.gsub(vim.fn.system('nvim --version'), '^%s*(.-)%s*$', '%1')) + let l:mkdp_server_script = s:mkdp_root_dir .. '/app/bin/markdown-preview-' .. mkdp#util#get_platform() if executable(l:mkdp_server_script) - call health#report_info('Pre build: ' . l:mkdp_server_script) - call health#report_info('Pre build version: ' . mkdp#util#pre_build_version()) - call health#report_ok('Using pre build') + lua vim.health.info('Pre build: ' .. vim.api.nvim_eval('l:mkdp_server_script')) + lua vim.health.info('Pre build version: ' .. vim.fn['mkdp#util#pre_build_version']()) + lua vim.health.ok('Using pre build') elseif executable('node') - call health#report_info('Node version: ' . system('node --version')) - let l:mkdp_server_script = s:mkdp_root_dir . '/app/server.js' - call health#report_info('Script: ' . l:mkdp_server_script) - call health#report_info('Script exists: ' . filereadable(l:mkdp_server_script)) - call health#report_ok('Using node') + lua vim.health.info('Node version: ' .. string.gsub(vim.fn.system('node --version'), '^%s*(.-)%s*$', '%1')) + let l:mkdp_server_script = s:mkdp_root_dir .. '/app/server.js' + lua vim.health.info('Script: ' .. vim.api.nvim_eval('l:mkdp_server_script')) + lua vim.health.info('Script exists: ' .. vim.fn.filereadable(vim.api.nvim_eval('l:mkdp_server_script'))) + lua vim.health.ok('Using node') endif endfunction