mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat: refactor all vim.loop -> vim.uv and add a shim when needed
This commit is contained in:
parent
83493db50a
commit
9e157df077
19 changed files with 53 additions and 51 deletions
|
@ -28,8 +28,8 @@ describe("lazy", function()
|
|||
"folke/paint.nvim",
|
||||
}, { install_missing = true, defaults = { lazy = true } })
|
||||
assert(3 == vim.tbl_count(Config.plugins))
|
||||
assert(vim.loop.fs_stat(root .. "/paint.nvim/README.md"))
|
||||
assert(vim.loop.fs_stat(root .. "/neodev.nvim/README.md"))
|
||||
assert(vim.uv.fs_stat(root .. "/paint.nvim/README.md"))
|
||||
assert(vim.uv.fs_stat(root .. "/neodev.nvim/README.md"))
|
||||
assert(not neodev)
|
||||
assert(Config.plugins["neodev.nvim"]._.installed)
|
||||
assert(not Config.plugins["neodev.nvim"]._.is_local)
|
||||
|
|
|
@ -12,7 +12,7 @@ describe("util", function()
|
|||
end
|
||||
end
|
||||
Helpers.fs_rm("")
|
||||
assert(not vim.loop.fs_stat(Helpers.path("")), "fs root should be deleted")
|
||||
assert(not vim.uv.fs_stat(Helpers.path("")), "fs root should be deleted")
|
||||
end)
|
||||
|
||||
it("lsmod lists all mods in dir", function()
|
||||
|
@ -85,7 +85,7 @@ describe("util", function()
|
|||
assert.same(Helpers.path("old/lua/foobar"), root)
|
||||
|
||||
Helpers.fs_rm("old")
|
||||
assert(not vim.loop.fs_stat(Helpers.path("old/lua/foobar")), "old/lua/foobar should not exist")
|
||||
assert(not vim.uv.fs_stat(Helpers.path("old/lua/foobar")), "old/lua/foobar should not exist")
|
||||
|
||||
-- vim.opt.rtp = rtp
|
||||
vim.opt.rtp:append(Helpers.path("new"))
|
||||
|
|
|
@ -26,12 +26,12 @@ function M.fs_rm(dir)
|
|||
dir = Util.norm(M.fs_root .. "/" .. dir)
|
||||
Util.walk(dir, function(path, _, type)
|
||||
if type == "directory" then
|
||||
vim.loop.fs_rmdir(path)
|
||||
vim.uv.fs_rmdir(path)
|
||||
else
|
||||
vim.loop.fs_unlink(path)
|
||||
vim.uv.fs_unlink(path)
|
||||
end
|
||||
end)
|
||||
vim.loop.fs_rmdir(dir)
|
||||
vim.uv.fs_rmdir(dir)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -9,7 +9,7 @@ end
|
|||
function M.load(plugin)
|
||||
local name = plugin:match(".*/(.*)")
|
||||
local package_root = M.root(".tests/site/pack/deps/start/")
|
||||
if not vim.loop.fs_stat(package_root .. name) then
|
||||
if not vim.uv.fs_stat(package_root .. name) then
|
||||
print("Installing " .. plugin)
|
||||
vim.fn.mkdir(package_root, "p")
|
||||
vim.fn.system({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue