From 9f3bd6f5685ee2946458eebe9692d213f7b4cfbf Mon Sep 17 00:00:00 2001 From: jayli Date: Thu, 7 Dec 2023 06:49:39 +0800 Subject: [PATCH] bugfix for #267 --- lua/easycomplete/tabnine.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lua/easycomplete/tabnine.lua b/lua/easycomplete/tabnine.lua index bb3f297b..7ca29e88 100644 --- a/lua/easycomplete/tabnine.lua +++ b/lua/easycomplete/tabnine.lua @@ -19,9 +19,12 @@ end function Export.init() Export.nvim_init_tabnine_hl() - vim.cmd [[ - autocmd ColorScheme * call v:lua.require("easycomplete.tabnine").nvim_init_tabnine_hl() - ]] + vim.api.nvim_create_autocmd({"ColorScheme"}, { + pattern = {"*"}, + callback = function() + Export.nvim_init_tabnine_hl() + end + }) end -- code_block 是一个字符串,有可能包含回车符