Add empty directory icons

This commit is contained in:
Cooper b. Anderson
2021-02-18 04:22:58 -05:00
committed by Kiyan
parent 7531c7023d
commit 25b414051f
3 changed files with 18 additions and 4 deletions

View File

@@ -15,6 +15,9 @@ local path_to_matching_str = require'lib.utils'.path_to_matching_str
local function dir_new(cwd, name)
local absolute_path = cwd..'/'..name
local stat = luv.fs_stat(absolute_path)
local handle = luv.fs_opendir(absolute_path, nil, 1)
local children = luv.fs_readdir(handle)
luv.fs_closedir(handle)
return {
name = name,
absolute_path = absolute_path,
@@ -23,6 +26,7 @@ local function dir_new(cwd, name)
match_name = path_to_matching_str(name),
match_path = path_to_matching_str(absolute_path),
open = false,
empty = children == nil,
entries = {}
}
end