@@ -5,7 +5,7 @@ local M = {
5
5
is_windows = vim .fn .has (' win32' ) == 1
6
6
}
7
7
8
- local function get_dir_git_status (parent_ignored , status , absolute_path )
8
+ function M . get_dir_git_status (parent_ignored , status , absolute_path )
9
9
if parent_ignored then
10
10
return ' !!'
11
11
end
@@ -14,13 +14,17 @@ local function get_dir_git_status(parent_ignored, status, absolute_path)
14
14
return dir_status or file_status
15
15
end
16
16
17
+ function M .get_git_status (parent_ignored , status , absolute_path )
18
+ return parent_ignored and ' !!' or status .files and status .files [absolute_path ]
19
+ end
20
+
17
21
function M .folder (absolute_path , name , status , parent_ignored )
18
22
local handle = uv .fs_scandir (absolute_path )
19
23
local has_children = handle and uv .fs_scandir_next (handle ) ~= nil
20
24
21
25
return {
22
26
absolute_path = absolute_path ,
23
- git_status = get_dir_git_status (parent_ignored , status , absolute_path ),
27
+ git_status = M . get_dir_git_status (parent_ignored , status , absolute_path ),
24
28
group_next = nil , -- If node is grouped, this points to the next child dir/link node
25
29
has_children = has_children ,
26
30
name = name ,
@@ -43,7 +47,7 @@ function M.file(absolute_path, name, status, parent_ignored)
43
47
absolute_path = absolute_path ,
44
48
executable = is_executable (absolute_path , ext ),
45
49
extension = ext ,
46
- git_status = parent_ignored and ' !! ' or status . files and status . files [ absolute_path ] ,
50
+ git_status = M . get_git_status ( parent_ignored , status , absolute_path ) ,
47
51
name = name ,
48
52
}
49
53
end
@@ -70,7 +74,7 @@ function M.link(absolute_path, name, status, parent_ignored)
70
74
71
75
return {
72
76
absolute_path = absolute_path ,
73
- git_status = parent_ignored and ' !! ' or status . files and status . files [ absolute_path ] ,
77
+ git_status = M . get_git_status ( parent_ignored , status , absolute_path ) ,
74
78
group_next = nil , -- If node is grouped, this points to the next child dir/link node
75
79
last_modified = last_modified ,
76
80
link_to = link_to ,
0 commit comments