Skip to content

Commit

Permalink
bugfix for #291
Browse files Browse the repository at this point in the history
  • Loading branch information
jayli committed Dec 30, 2023
1 parent 30fa2dd commit 71abdd8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions autoload/easycomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2244,6 +2244,9 @@ function! easycomplete#CursorMovedI()
if g:env_is_nvim && easycomplete#pum#visible()
call easycomplete#pum#close()
endif
if easycomplete#action#signature#visible()
call easycomplete#popup#close("float")
endif
endif
endfunction

Expand Down
4 changes: 4 additions & 0 deletions autoload/easycomplete/action/signature.vim
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ function! s:SignatureCallback(title, param, doc)
\ 'Pmenu', 0, "", [0, 0 - offset], 'signature')
endfunction

function! easycomplete#action#signature#visible()
return easycomplete#popup#SignatureVisible()
endfunction

function! s:GetParameterLabel(signature, parameter) abort
if has_key(a:parameter, 'label')
if type(a:parameter['label']) == type([])
Expand Down
14 changes: 13 additions & 1 deletion autoload/easycomplete/popup.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let s:float_max_height = 15
let s:is_vim = !has('nvim')
let s:is_nvim = has('nvim')
" signature/lint
let s:float_type = "signature"
let s:float_type = ""

augroup easycomplete#popup#au
autocmd!
Expand Down Expand Up @@ -230,6 +230,15 @@ function! easycomplete#popup#float(content, hl, direction, ft, offset, float_typ
elseif s:is_vim
call s:VimShow(opt, "float", a:float_type)
endif
let s:float_type = a:float_type
endfunction

function! easycomplete#popup#SignatureVisible()
if empty(s:float_type) || empty(g:easycomplete_popup_win["float"])
return v:false
else
return v:true
endif
endfunction

" 这里只判断complete menu和float 之间是否有overlay
Expand Down Expand Up @@ -556,6 +565,9 @@ function! easycomplete#popup#close(...)
return
endif
let windowtype = a:1
if windowtype == "float"
let s:float_type = ""
endif
if windowtype == "float" &&
\ bufnr() != expand("<abuf>") &&
\ !empty(expand("<abuf>")) &&
Expand Down

0 comments on commit 71abdd8

Please sign in to comment.