Skip to content

Commit

Permalink
fix: don't show completions when trigger context is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Oct 24, 2024
1 parent 6b24f48 commit 5b39d83
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/blink/cmp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ cmp.setup = function(opts)

-- we avoid adding 0.5-4ms to insertion latency by scheduling for later
vim.schedule(function()
if cmp.trigger.context == nil or cmp.trigger.context.id ~= context.id then return end

local filtered_items = cmp.fuzzy.filter_items(cmp.fuzzy.get_query(), items)
filtered_items = cmp.sources.apply_max_items_for_completions(context, filtered_items)
if #filtered_items > 0 then
Expand Down

0 comments on commit 5b39d83

Please sign in to comment.