diff --git a/compcount.lua b/compcount.lua index 06f4ac8..7759fc6 100644 --- a/compcount.lua +++ b/compcount.lua @@ -495,6 +495,17 @@ local function getEquivalentLevelCounts(baseId, pageItems, itemCounts) return equivalentCounts end +local function getEquivalentBaseCounts(baseIds, itemCounts) + local equivalentCounts = {} + + for i = 1, #baseIds do + local baseId = baseIds[i] + equivalentCounts[baseId] = getBaseEquivalentCount(baseId, itemCounts) + end + + return equivalentCounts +end + local function createGlobalCountRefreshJob() ensureChainsLoaded() @@ -1146,7 +1157,7 @@ drawOverview = function() local counts = getGlobalItemCounts() if next(counts) ~= nil then - overviewCachedCounts = counts + overviewCachedCounts = getEquivalentBaseCounts(items, counts) end return overviewCachedCounts @@ -1159,7 +1170,7 @@ drawOverview = function() overviewScrollTargetRow = targetRow end, getEntriesAndCountsFromCache = function() - overviewCachedCounts = getGlobalItemCounts() + overviewCachedCounts = getEquivalentBaseCounts(items, getGlobalItemCounts()) overviewCachedSortedItemIds = sortOverviewItems(overviewCachedCounts) return overviewCachedSortedItemIds, overviewCachedCounts end,