mirror of
https://github.com/neovim/neovim.git
synced 2026-08-19 02:24:46 -05:00
fix(health): check shell performance using vim.fn.system() #36980
Problem:
`vim.system()` doesn't invoke a shell, while the Vimscript function
`system()` does.
Solution:
Revert the change from 35af766de6 and use `vim.fn.system()` again to
actually invoke a shell.
This commit is contained in:
@@ -175,7 +175,8 @@ local function check_performance()
|
|||||||
-- check for slow shell invocation
|
-- check for slow shell invocation
|
||||||
local slow_cmd_time = 1.5e9
|
local slow_cmd_time = 1.5e9
|
||||||
local start_time = vim.uv.hrtime()
|
local start_time = vim.uv.hrtime()
|
||||||
system({ 'echo' })
|
-- Vimscript's sytem() is used to actually invoke a shell
|
||||||
|
vim.fn.system('echo')
|
||||||
local elapsed_time = vim.uv.hrtime() - start_time
|
local elapsed_time = vim.uv.hrtime() - start_time
|
||||||
if elapsed_time > slow_cmd_time then
|
if elapsed_time > slow_cmd_time then
|
||||||
health.warn(
|
health.warn(
|
||||||
|
|||||||
Reference in New Issue
Block a user