Skip to content

Commit

Permalink
fix: one more item than max_item_count is displayed (hrsh7th#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyu authored Feb 2, 2024
1 parent 538e37b commit 04e0ca3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/cmp/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ view.open = function(self, ctx, sources)
-- filter by max_item_count.
for _, e in ipairs(group_entries) do
if max_item_counts[e.source.name] ~= nil then
if max_item_counts[e.source.name] >= 0 then
if max_item_counts[e.source.name] > 0 then
max_item_counts[e.source.name] = max_item_counts[e.source.name] - 1
table.insert(entries, e)
end
Expand Down

0 comments on commit 04e0ca3

Please sign in to comment.