From 8c42c02706397651423a4f6dc4866d734b1be071 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 11 Aug 2025 13:46:19 +1000 Subject: [PATCH] simplify MAX_FOLDER_DISCOVERY warning --- lua/nvim-tree/actions/tree/modifiers/expand.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lua/nvim-tree/actions/tree/modifiers/expand.lua b/lua/nvim-tree/actions/tree/modifiers/expand.lua index 473195cb..5d28bdea 100644 --- a/lua/nvim-tree/actions/tree/modifiers/expand.lua +++ b/lua/nvim-tree/actions/tree/modifiers/expand.lua @@ -33,6 +33,7 @@ local function limit_folder_discovery(should_descend) return function(expansion_count, node) local should_halt = expansion_count >= M.MAX_FOLDER_DISCOVERY if should_halt then + notify.warn("expansion iteration was halted after " .. M.MAX_FOLDER_DISCOVERY .. " discovered folders") return false end @@ -121,10 +122,6 @@ local function gen_iterator(should_descend) return nil end) :iterate() - - if expansion_count >= M.MAX_FOLDER_DISCOVERY then - return true - end end end @@ -135,9 +132,7 @@ local function expand_node(node, expand_opts) return end local descend_until = limit_folder_discovery((expand_opts and expand_opts.expand_until) or descend_until_empty) - if gen_iterator(descend_until)(node) then - notify.warn("expansion iteration was halted after " .. M.MAX_FOLDER_DISCOVERY .. " discovered folders") - end + gen_iterator(descend_until)(node) local explorer = core.get_explorer() if explorer then