Skip to content

Commit 4657d2a

Browse files
committed
bugfix for tabnine secondcomplete flashing
1 parent 7eccdb2 commit 4657d2a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

autoload/easycomplete.vim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,16 @@ function! s:CompleteTypingMatch(...)
337337
else
338338
call s:CloseCompletionMenu()
339339
endif
340+
call easycomplete#sources#tn#SetGlobalSourceItems([])
340341
else
341342
let start_pos = col('.') - strlen(word)
342-
let b:easycomplete_tn_match_done = 1
343-
call s:SecondCompleteRendering(start_pos, tn_result)
343+
" call s:SecondCompleteRendering(start_pos, tn_result)
344+
" 这里如果执行了匹配,tabnine 还会在 20ms
345+
" 后有一个返回,导致闪烁,因此这里也需要加一个延迟,而不应该直接
346+
" 执行 Rendering,和 SecondComplete中的逻辑一样
347+
call easycomplete#sources#tn#SetGlobalSourceItems(tn_result)
348+
let b:easycomplete_tn_match_done = 0
349+
call easycomplete#util#timer_start("easycomplete#UpdateTNPlaceHolder", [word], 20)
344350
endif
345351
let g:easycomplete_stunt_menuitems = []
346352
return

0 commit comments

Comments
 (0)