Skip to content

Commit

Permalink
fix: prefetch first item when selection == 'manual' | 'auto_insert'
Browse files Browse the repository at this point in the history
Related to #627
  • Loading branch information
Saghen committed Dec 17, 2024
1 parent c3ef922 commit a8222cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/blink/cmp/completion/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ function completion.setup()
-- run 'resolve' on the item ahead of time to avoid delays
-- when accepting the item or showing documentation
list.select_emitter:on(function(event)
if event.item == nil then return end
-- when selection == 'manual' | 'auto_insert', we still want to prefetch the first item
local item = event.item or list.items[1]
if item == nil then return end
require('blink.cmp.completion.prefetch')(event.context, event.item)
end)
end
Expand Down

0 comments on commit a8222cf

Please sign in to comment.