Skip to content

Commit

Permalink
chore(test): fix undefined-field warning
Browse files Browse the repository at this point in the history
- Ignore `undefined-field` warning (it is defined)
- Replace `vim.loop` (deprecated) with `vim.uv`
  • Loading branch information
tmillr committed Jul 29, 2024
1 parent 26827d5 commit 41c8c35
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/init.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
local status, error = pcall(function()
local uv = vim.uv or vim.loop
local root = vim.fn.fnamemodify('.repro', ':p')
local lazypath = root .. '/plugins/lazy.nvim'
for _, name in ipairs({ 'config', 'data', 'state', 'cache' }) do
vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
end

local lazypath = root .. '/plugins/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
---@diagnostic disable-next-line: undefined-field
if not uv.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
Expand All @@ -14,6 +16,7 @@ local status, error = pcall(function()
lazypath,
})
end

vim.opt.runtimepath:prepend(lazypath)

require('lazy').setup({
Expand All @@ -32,4 +35,5 @@ end)
if error then
print(error)
end

vim.cmd(status and '0cq' or '1cq')

0 comments on commit 41c8c35

Please sign in to comment.