We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65fb5e4 commit d4dc784Copy full SHA for d4dc784
lua/neo-tree/events/queue.lua
@@ -71,10 +71,12 @@ function Queue:for_each(func)
71
local node = self._list.head
72
while node ~= nil do
73
local result = func(node.value)
74
+ local node_is_next = false
75
if result then
76
if type(result) == "boolean" then
77
local node_to_remove = node
78
node = node.next
79
+ node_is_next = true
80
self._list:remove_node(node_to_remove)
81
elseif type(result) == "table" then
82
if type(result.handled) == "boolean" and result.handled == true then
@@ -88,8 +90,8 @@ function Queue:for_each(func)
88
90
return result
89
91
end
92
- node = node.next
- else
93
+ end
94
+ if not node_is_next then
95
96
97
0 commit comments