From 04e0ca376d6abdbfc8b52180f8ea236cbfddf782 Mon Sep 17 00:00:00 2001 From: Yu Zhang Date: Fri, 2 Feb 2024 15:59:47 +0900 Subject: [PATCH] fix: one more item than max_item_count is displayed (#1811) --- lua/cmp/view.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cmp/view.lua b/lua/cmp/view.lua index dc3251d9f..aa184c206 100644 --- a/lua/cmp/view.lua +++ b/lua/cmp/view.lua @@ -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