simplify MAX_FOLDER_DISCOVERY warning
This commit is contained in:
parent
8ecfcd04b9
commit
8c42c02706
@ -33,6 +33,7 @@ local function limit_folder_discovery(should_descend)
|
|||||||
return function(expansion_count, node)
|
return function(expansion_count, node)
|
||||||
local should_halt = expansion_count >= M.MAX_FOLDER_DISCOVERY
|
local should_halt = expansion_count >= M.MAX_FOLDER_DISCOVERY
|
||||||
if should_halt then
|
if should_halt then
|
||||||
|
notify.warn("expansion iteration was halted after " .. M.MAX_FOLDER_DISCOVERY .. " discovered folders")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -121,10 +122,6 @@ local function gen_iterator(should_descend)
|
|||||||
return nil
|
return nil
|
||||||
end)
|
end)
|
||||||
:iterate()
|
:iterate()
|
||||||
|
|
||||||
if expansion_count >= M.MAX_FOLDER_DISCOVERY then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -135,9 +132,7 @@ local function expand_node(node, expand_opts)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
local descend_until = limit_folder_discovery((expand_opts and expand_opts.expand_until) or descend_until_empty)
|
local descend_until = limit_folder_discovery((expand_opts and expand_opts.expand_until) or descend_until_empty)
|
||||||
if gen_iterator(descend_until)(node) then
|
gen_iterator(descend_until)(node)
|
||||||
notify.warn("expansion iteration was halted after " .. M.MAX_FOLDER_DISCOVERY .. " discovered folders")
|
|
||||||
end
|
|
||||||
|
|
||||||
local explorer = core.get_explorer()
|
local explorer = core.get_explorer()
|
||||||
if explorer then
|
if explorer then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user