Skip to content

Commit 41c8c35

Browse files
committed
chore(test): fix undefined-field warning
- Ignore `undefined-field` warning (it is defined) - Replace `vim.loop` (deprecated) with `vim.uv`
1 parent 26827d5 commit 41c8c35

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/init.lua

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
local status, error = pcall(function()
2+
local uv = vim.uv or vim.loop
23
local root = vim.fn.fnamemodify('.repro', ':p')
4+
local lazypath = root .. '/plugins/lazy.nvim'
35
for _, name in ipairs({ 'config', 'data', 'state', 'cache' }) do
46
vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
57
end
68

7-
local lazypath = root .. '/plugins/lazy.nvim'
8-
if not vim.loop.fs_stat(lazypath) then
9+
---@diagnostic disable-next-line: undefined-field
10+
if not uv.fs_stat(lazypath) then
911
vim.fn.system({
1012
'git',
1113
'clone',
@@ -14,6 +16,7 @@ local status, error = pcall(function()
1416
lazypath,
1517
})
1618
end
19+
1720
vim.opt.runtimepath:prepend(lazypath)
1821

1922
require('lazy').setup({
@@ -32,4 +35,5 @@ end)
3235
if error then
3336
print(error)
3437
end
38+
3539
vim.cmd(status and '0cq' or '1cq')

0 commit comments

Comments
 (0)