@@ -47,30 +47,28 @@ local function set_folder_hl(line, depth, icon_len, name_len, hl_icongroup, hl_f
47
47
table.insert (hl , { hl_fnamegroup , line , depth + icon_len , depth + icon_len + name_len + get_trailing_length () })
48
48
end
49
49
50
- local function get_file_icon_default (_ , _ , line , depth , hl )
50
+ local function get_file_icon_default ()
51
51
local hl_group = " NvimTreeFileIcon"
52
52
local icon = M .icons .default
53
53
if # icon > 0 then
54
- table.insert (hl , { hl_group , line , depth , depth + # icon + 1 })
54
+ return icon .. M .padding , hl_group
55
+ else
56
+ return " "
55
57
end
56
- return # icon > 0 and icon .. M .padding or " "
57
58
end
58
59
59
- local function get_file_icon_webdev (fname , extension , line , depth , hl )
60
+ local function get_file_icon_webdev (fname , extension )
60
61
local icon , hl_group = M .devicons .get_icon (fname , extension )
61
62
if not M .webdev_colors then
62
63
hl_group = " NvimTreeFileIcon"
63
64
end
64
65
if icon and hl_group ~= " DevIconDefault" then
65
- if hl_group then
66
- table.insert (hl , { hl_group , line , depth , depth + # icon + 1 })
67
- end
68
- return icon .. M .padding
66
+ return icon .. M .padding , hl_group
69
67
elseif string.match (extension , " %.(.*)" ) then
70
68
-- If there are more extensions to the file, try to grab the icon for them recursively
71
- return M . get_file_icon (fname , string.match (extension , " %.(.*)" ), line , depth , hl )
69
+ return get_file_icon_webdev (fname , string.match (extension , " %.(.*)" ))
72
70
else
73
- return get_file_icon_default (fname , extension , line , depth , hl )
71
+ return get_file_icon_default ()
74
72
end
75
73
end
76
74
0 commit comments