diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-06-03 11:06:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-03 12:06:00 +0200 |
commit | 2db719f6c2b677fcbc197b02fe52764a851523b2 (patch) | |
tree | 648885f655ea6eea2d6b5ad9409bc18c3b49e0f7 /runtime/lua/vim/fs.lua | |
parent | c65e2203f70cd5d66fcb8ffb26f8cef38f50e04f (diff) | |
download | rneovim-2db719f6c2b677fcbc197b02fe52764a851523b2.tar.gz rneovim-2db719f6c2b677fcbc197b02fe52764a851523b2.tar.bz2 rneovim-2db719f6c2b677fcbc197b02fe52764a851523b2.zip |
feat(lua): rename vim.loop -> vim.uv (#22846)
Diffstat (limited to 'runtime/lua/vim/fs.lua')
-rw-r--r-- | runtime/lua/vim/fs.lua | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/runtime/lua/vim/fs.lua b/runtime/lua/vim/fs.lua index 864ba495f1..5e63fb6237 100644 --- a/runtime/lua/vim/fs.lua +++ b/runtime/lua/vim/fs.lua @@ -1,6 +1,6 @@ local M = {} -local iswin = vim.loop.os_uname().sysname == 'Windows_NT' +local iswin = vim.uv.os_uname().sysname == 'Windows_NT' --- Iterate over all the parents of the given file or directory. --- @@ -106,12 +106,12 @@ function M.dir(path, opts) }) if not opts.depth or opts.depth == 1 then - local fs = vim.loop.fs_scandir(M.normalize(path)) + local fs = vim.uv.fs_scandir(M.normalize(path)) return function() if not fs then return end - return vim.loop.fs_scandir_next(fs) + return vim.uv.fs_scandir_next(fs) end end @@ -121,9 +121,9 @@ function M.dir(path, opts) while #dirs > 0 do local dir0, level = unpack(table.remove(dirs, 1)) local dir = level == 1 and dir0 or M.joinpath(path, dir0) - local fs = vim.loop.fs_scandir(M.normalize(dir)) + local fs = vim.uv.fs_scandir(M.normalize(dir)) while fs do - local name, t = vim.loop.fs_scandir_next(fs) + local name, t = vim.uv.fs_scandir_next(fs) if not name then break end @@ -158,7 +158,7 @@ end --- -- location of Cargo.toml from the current buffer's path --- local cargo = vim.fs.find('Cargo.toml', { --- upward = true, ---- stop = vim.loop.os_homedir(), +--- stop = vim.uv.os_homedir(), --- path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)), --- }) --- @@ -212,7 +212,7 @@ function M.find(names, opts) names = type(names) == 'string' and { names } or names - local path = opts.path or vim.loop.cwd() + local path = opts.path or vim.uv.cwd() local stop = opts.stop local limit = opts.limit or 1 @@ -244,7 +244,7 @@ function M.find(names, opts) local t = {} for _, name in ipairs(names) do local f = M.joinpath(p, name) - local stat = vim.loop.fs_stat(f) + local stat = vim.uv.fs_stat(f) if stat and (not opts.type or opts.type == stat.type) then t[#t + 1] = f end @@ -337,7 +337,7 @@ function M.normalize(path, opts) }) if path:sub(1, 1) == '~' then - local home = vim.loop.os_homedir() or '~' + local home = vim.uv.os_homedir() or '~' if home:sub(-1) == '\\' or home:sub(-1) == '/' then home = home:sub(1, -2) end @@ -345,7 +345,7 @@ function M.normalize(path, opts) end if opts.expand_env == nil or opts.expand_env then - path = path:gsub('%$([%w_]+)', vim.loop.os_getenv) + path = path:gsub('%$([%w_]+)', vim.uv.os_getenv) end path = path:gsub('\\', '/'):gsub('/+', '/') |