small fix

This commit is contained in:
kiyan42 2020-02-07 11:51:01 +01:00
parent 9dfc4b27ef
commit 98716c9a83

View File

@ -123,7 +123,7 @@ local function open_file(open_type)
local tree_index = api.nvim_win_get_cursor(0)[1] local tree_index = api.nvim_win_get_cursor(0)[1]
local node = Tree[tree_index] local node = Tree[tree_index]
if is_dir(node.path .. node.name) then if node.dir == true then
local index = tree_index + 1; local index = tree_index + 1;
local next_node = Tree[index] local next_node = Tree[index]
if next_node ~= nil and next_node.depth > node.depth then if next_node ~= nil and next_node.depth > node.depth then
@ -134,8 +134,8 @@ local function open_file(open_type)
else else
local dirlist = syslist('ls ' .. node.path .. node.name) local dirlist = syslist('ls ' .. node.path .. node.name)
local child_dirs = create_dirs(node.path .. node.name .. '/', node.depth + 1, dirlist) local child_dirs = create_dirs(node.path .. node.name .. '/', node.depth + 1, dirlist)
for i, node in pairs(child_dirs) do for i, n in pairs(child_dirs) do
table.insert(Tree, tree_index + i, node) table.insert(Tree, tree_index + i, n)
end end
end end