Closed bangedorrunt closed 3 years ago
Can you try this?
diff --git a/lua/cmp_tabnine/source.lua b/lua/cmp_tabnine/source.lua
index 8317372..13923fc 100644
--- a/lua/cmp_tabnine/source.lua
+++ b/lua/cmp_tabnine/source.lua
@@ -150,10 +150,6 @@ function Source.complete(self, ctx, callback)
Source._do_complete(ctx)
end
-Source._on_err = function(_, _, _)
- table.remove(Source.ctx_list, 1)
-end
-
Source._on_exit = function(_, code)
-- restart..
if code == 143 then
@@ -167,7 +163,7 @@ Source._on_exit = function(_, code)
end
Source.ctx_list = {}
Source.job = fn.jobstart({bin, '--client=cmp.vim'}, {
- on_stderr = Source._on_stderr;
+ on_stderr = nil;
on_exit = Source._on_exit;
on_stdout = Source._on_stdout;
})
@@ -187,7 +183,10 @@ Source._on_stdout = function(_, data, _)
-- "user_message": [],
-- "docs": []
-- }
- -- dump(data)
+ -- check that we have a context.
+ if #Source.ctx_list == 0 then
+ return
+ end
local items = {}
local old_prefix = ""
local show_strength = conf:get('show_prediction_strength')
@tzachar git apply
the patch failed to me so I had to do it manually, it seems the bug is fixed. I did some fresh install and no error shown up. Thank you!
I got this error when first install
cmp-tabnine
I'm using