Skip to content

Commit

Permalink
bugfix for #281
Browse files Browse the repository at this point in the history
  • Loading branch information
jayli committed Dec 16, 2023
1 parent da5c042 commit 330dbdf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion autoload/easycomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,8 @@ function! easycomplete#TextChangedI()
call easycomplete#tabnine#flush()
call easycomplete#typing()
if easycomplete#ok('g:easycomplete_signature_enable')
call easycomplete#action#signature#handle()
" hack for #281
call timer_start(50, { -> easycomplete#action#signature#handle()})
endif
let b:old_changedtick = b:changedtick
return ""
Expand Down
9 changes: 5 additions & 4 deletions autoload/easycomplete/action/signature.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ endfunction
function! easycomplete#action#signature#handle()
let typed = s:GetTyped()
if easycomplete#IsBacking()
if typed =~ "\\w($" || (typed =~ "\\w(.*,$" && getline(".") =~ "(")
if easycomplete#action#signature#FireCondition()
call s:do()
else
call s:close()
Expand All @@ -34,15 +34,16 @@ function! easycomplete#action#signature#handle()
endif
if typed =~ ")$"
call s:close()
elseif typed =~ "\\w($" || (typed =~ "\\w(.*,$" && getline(".") =~ "(")
elseif easycomplete#action#signature#FireCondition()
call s:do()
endif
" call s:close()
endif
endfunction

function! s:ShouldClose()
let typed = s:GetTyped()
function! easycomplete#action#signature#FireCondition()
let l:typed = s:GetTyped()
return l:typed =~ "\\w($" || (l:typed =~ "\\w(.*,$" && getline(".") =~ "(")
endfunction

function! s:GetTyped()
Expand Down
2 changes: 2 additions & 0 deletions autoload/easycomplete/popup.vim
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ function! easycomplete#popup#close(...)
let id = win_id2win(g:easycomplete_popup_win[windowtype])
if id > 0
let winid = g:easycomplete_popup_win[windowtype]
" 这里的hack有一定的隐患,这里的timer有可能给completedone事件带来干扰
" ref: #281
if !(&completeopt =~ "noselect")
let delay = 20
else
Expand Down

0 comments on commit 330dbdf

Please sign in to comment.