Skip to content

Commit 19425c5

Browse files
committed
refactor(renderer): extract bools into variables
1 parent 8632ac2 commit 19425c5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lua/nvim-tree/renderer/components/padding.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,17 @@ end
3535
function M.get_padding(depth, idx, nodes_number, node, markers)
3636
local padding = ""
3737

38-
if M.config.indent_markers.enable then
39-
padding = padding
40-
.. get_padding_indent_markers(depth, idx, nodes_number, markers, M.config.icons.show.folder_arrow, node)
38+
local show_arrows = M.config.icons.show.folder_arrow
39+
local show_markers = M.config.indent_markers.enable
40+
41+
if show_markers then
42+
padding = padding .. get_padding_indent_markers(depth, idx, nodes_number, markers, show_arrows, node)
4143
else
4244
padding = padding .. string.rep(" ", depth)
4345
end
4446

45-
if M.config.icons.show.folder_arrow then
46-
padding = padding .. get_padding_arrows(node, not M.config.indent_markers.enable)
47+
if show_arrows then
48+
padding = padding .. get_padding_arrows(node, not show_markers)
4749
end
4850

4951
return padding

0 commit comments

Comments
 (0)