Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lua/blink/cmp/sources/lib/provider/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,19 @@ function source:should_show_items(context, items)
end
end

local min_keyword_length = math.max(provider_min_keyword_length, global_min_keyword_length)
local min_keyword_length = global_min_keyword_length
if provider_min_keyword_length > 0 then min_keyword_length = provider_min_keyword_length end

local current_keyword_length = context.bounds.length
if current_keyword_length < min_keyword_length then return false end

-- check if the source wants to show items
if self.module.should_show_items ~= nil and not self.module:should_show_items(context, items) then return false end

-- check if the user wants to show items
if self.config.should_show_items == nil then return true end
return self.config.should_show_items(context, items)
if self.config.should_show_items ~= nil and not self.config.should_show_items(context, items) then return false end

return true
end

function source:transform_items(context, items)
Expand Down