Skip to content

Commit 8c42c02

Browse files
committed
simplify MAX_FOLDER_DISCOVERY warning
1 parent 8ecfcd0 commit 8c42c02

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lua/nvim-tree/actions/tree/modifiers/expand.lua

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ local function limit_folder_discovery(should_descend)
3333
return function(expansion_count, node)
3434
local should_halt = expansion_count >= M.MAX_FOLDER_DISCOVERY
3535
if should_halt then
36+
notify.warn("expansion iteration was halted after " .. M.MAX_FOLDER_DISCOVERY .. " discovered folders")
3637
return false
3738
end
3839

@@ -121,10 +122,6 @@ local function gen_iterator(should_descend)
121122
return nil
122123
end)
123124
:iterate()
124-
125-
if expansion_count >= M.MAX_FOLDER_DISCOVERY then
126-
return true
127-
end
128125
end
129126
end
130127

@@ -135,9 +132,7 @@ local function expand_node(node, expand_opts)
135132
return
136133
end
137134
local descend_until = limit_folder_discovery((expand_opts and expand_opts.expand_until) or descend_until_empty)
138-
if gen_iterator(descend_until)(node) then
139-
notify.warn("expansion iteration was halted after " .. M.MAX_FOLDER_DISCOVERY .. " discovered folders")
140-
end
135+
gen_iterator(descend_until)(node)
141136

142137
local explorer = core.get_explorer()
143138
if explorer then

0 commit comments

Comments
 (0)