File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,18 @@ cmp.setup = function(opts)
37
37
-- we store the previous items so we can immediately perform fuzzy matching on keystroke
38
38
-- and then update again when the sources return new results
39
39
local last_items = {}
40
+ local last_context = nil
40
41
local function update_completions (context , items )
41
- if items == nil then items = last_items end
42
+ if items == nil then
43
+ if last_context == nil or last_context .id ~= context .id then return end
44
+ items = last_items
45
+ end
46
+ last_context = context
42
47
last_items = items
48
+
43
49
-- we avoid adding 1-4ms to insertion latency by scheduling for later
44
50
vim .schedule (function ()
45
- local filtered_items = cmp .fuzzy .filter_items (require (' blink.cmp.util ' ).get_query (), items )
51
+ local filtered_items = cmp .fuzzy .filter_items (require (' blink.cmp.utils ' ).get_query (), items )
46
52
if # filtered_items > 0 then
47
53
cmp .windows .autocomplete .open_with_items (context , filtered_items )
48
54
else
You can’t perform that action at this time.
0 commit comments