diff options
Diffstat (limited to 'lua/telescope/entry_manager.lua')
| -rw-r--r-- | lua/telescope/entry_manager.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lua/telescope/entry_manager.lua b/lua/telescope/entry_manager.lua index ff8b9ba..5055171 100644 --- a/lua/telescope/entry_manager.lua +++ b/lua/telescope/entry_manager.lua @@ -155,7 +155,10 @@ function EntryManager:add_entry(picker, score, entry) info.looped = info.looped + 1 if container[2] > score then - -- print("Inserting: ", picker, index, node, new_container) + return self:_insert_container_before(picker, index, node, new_container) + end + + if score < 1 and container[2] == score and #entry.ordinal < #container[1].ordinal then return self:_insert_container_before(picker, index, node, new_container) end @@ -174,11 +177,13 @@ function EntryManager:add_entry(picker, score, entry) end function EntryManager:iter() - return coroutine.wrap(function() - for val in self.linked_states:iter() do - coroutine.yield(val[1]) + local iterator = self.linked_states:iter() + return function() + local val = iterator() + if val then + return val[1] end - end) + end end return EntryManager |
