diff options
| author | Tom Ampuero <46233260+tampueroc@users.noreply.github.com> | 2025-06-29 15:56:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-29 14:56:44 +0000 |
| commit | 2f95abddfaf8921555a7e252fc77ed26cbb4de5c (patch) | |
| tree | 59f287f5b908a6d2ffca67997f24b487eaf0ce76 /runtime/lua/vim | |
| parent | 1c52e90cd57c0ae3a289701fb658061a511a6756 (diff) | |
| download | rneovim-2f95abddfaf8921555a7e252fc77ed26cbb4de5c.tar.gz rneovim-2f95abddfaf8921555a7e252fc77ed26cbb4de5c.tar.bz2 rneovim-2f95abddfaf8921555a7e252fc77ed26cbb4de5c.zip | |
refactor(health): use vim.system():wait() #34702
Problem:
- The ripgrep probe still used the legacy `vim.fn.system()`
Solution:
- Replace `vim.fn.system()` with `vim.system({rg_path, '-V'}):wait()`
Diffstat (limited to 'runtime/lua/vim')
| -rw-r--r-- | runtime/lua/vim/health/health.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/lua/vim/health/health.lua b/runtime/lua/vim/health/health.lua index dd6fe7f608..14bc7b53e5 100644 --- a/runtime/lua/vim/health/health.lua +++ b/runtime/lua/vim/health/health.lua @@ -399,10 +399,13 @@ local function check_external_tools() health.start('External Tools') if vim.fn.executable('rg') == 1 then - local rg = vim.fn.exepath('rg') - local cmd = 'rg -V' - local out = vim.fn.system(vim.fn.split(cmd)) - health.ok(('%s (%s)'):format(vim.trim(out), rg)) + local rg_path = vim.fn.exepath('rg') + local rg_job = vim.system({ rg_path, '-V' }):wait() + if rg_job.code == 0 then + health.ok(('%s (%s)'):format(vim.trim(rg_job.stdout), rg_path)) + else + health.warn('found `rg` but failed to run `rg -V`', { rg_job.stderr }) + end else health.warn('ripgrep not available') end |