1
1
local M = {}
2
2
3
- local function get_padding_indent_markers (depth , idx , nodes_number , markers )
4
- local padding = " "
3
+ local function get_padding_indent_markers (depth , idx , nodes_number , markers , with_arrows , node )
4
+ local default_padding = with_arrows and (not node .nodes or depth > 0 ) and " " or " "
5
+ local padding = depth == 0 and default_padding or " "
5
6
6
- if depth ~= 0 then
7
+ if depth > 0 then
7
8
local rdepth = depth / 2
8
9
markers [rdepth ] = idx ~= nodes_number
9
10
for i = 1 , rdepth do
10
11
if idx == nodes_number and i == rdepth then
11
- padding = padding .. M .config .indent_markers .icons .corner
12
+ padding = padding .. default_padding .. M .config .indent_markers .icons .corner
12
13
elseif markers [i ] and i == rdepth then
13
- padding = padding .. M .config .indent_markers .icons .item
14
+ padding = padding .. default_padding .. M .config .indent_markers .icons .item
14
15
elseif markers [i ] then
15
- padding = padding .. M .config .indent_markers .icons .edge
16
+ padding = padding .. default_padding .. M .config .indent_markers .icons .edge
16
17
else
17
- padding = padding .. M .config .indent_markers .icons .none
18
+ padding = padding .. default_padding .. M .config .indent_markers .icons .none
18
19
end
19
20
end
20
21
end
@@ -35,7 +36,8 @@ function M.get_padding(depth, idx, nodes_number, node, markers)
35
36
local padding = " "
36
37
37
38
if M .config .indent_markers .enable then
38
- padding = padding .. get_padding_indent_markers (depth , idx , nodes_number , markers )
39
+ padding = padding
40
+ .. get_padding_indent_markers (depth , idx , nodes_number , markers , M .config .icons .show .folder_arrow , node )
39
41
else
40
42
padding = padding .. string.rep (" " , depth )
41
43
end
0 commit comments