fix: replace vim.* "requires" with explicit calls to vim functions (#1701)
This commit is contained in:
committed by
GitHub
parent
6d6a44626d
commit
8cc369695b
@@ -1,5 +1,3 @@
|
||||
local uv = vim.loop
|
||||
|
||||
local utils = require "nvim-tree.utils"
|
||||
local builders = require "nvim-tree.explorer.node-builders"
|
||||
local common = require "nvim-tree.explorer.common"
|
||||
@@ -11,14 +9,14 @@ local notify = require "nvim-tree.notify"
|
||||
local M = {}
|
||||
|
||||
local function get_type_from(type_, cwd)
|
||||
return type_ or (uv.fs_stat(cwd) or {}).type
|
||||
return type_ or (vim.loop.fs_stat(cwd) or {}).type
|
||||
end
|
||||
|
||||
local function populate_children(handle, cwd, node, status)
|
||||
local node_ignored = node.git_status == "!!"
|
||||
local nodes_by_path = utils.bool_record(node.nodes, "absolute_path")
|
||||
while true do
|
||||
local name, t = uv.fs_scandir_next(handle)
|
||||
local name, t = vim.loop.fs_scandir_next(handle)
|
||||
if not name then
|
||||
break
|
||||
end
|
||||
@@ -31,7 +29,7 @@ local function populate_children(handle, cwd, node, status)
|
||||
and not nodes_by_path[abs]
|
||||
then
|
||||
local child = nil
|
||||
if t == "directory" and uv.fs_access(abs, "R") then
|
||||
if t == "directory" and vim.loop.fs_access(abs, "R") then
|
||||
child = builders.folder(node, abs, name)
|
||||
elseif t == "file" then
|
||||
child = builders.file(node, abs, name)
|
||||
@@ -51,7 +49,7 @@ local function populate_children(handle, cwd, node, status)
|
||||
end
|
||||
|
||||
local function get_dir_handle(cwd)
|
||||
local handle = uv.fs_scandir(cwd)
|
||||
local handle = vim.loop.fs_scandir(cwd)
|
||||
if type(handle) == "string" then
|
||||
notify.error(handle)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user