Skip to content

Commit

Permalink
update te#complete#lookup_reference
Browse files Browse the repository at this point in the history
Signed-off-by: tracyone <[email protected]>
  • Loading branch information
tracyone committed Dec 16, 2021
1 parent e77ce07 commit b78ea74
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions autoload/te/complete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,16 @@ endfunction


function te#complete#lookup_reference(open_type) abort
if get(g:, 'feat_enable_complete', 0)
execute a:open_type
if te#env#SupportYcm() && g:complete_plugin_type.cur_val ==# 'YouCompleteMe'
:YcmCompleter GoToReferences
else
let l:ret=te#lsp#references()
if l:ret == -1
" use ctags or cscope
:cs find c <C-R>=expand("<cword>")<CR><CR>:botright cw 7
endif
endif
return 0
execute a:open_type
if g:feat_enable_lsp == 1
let l:ret=te#lsp#references()
elseif &ft == 'c'
" use ctags or cscope
:cs find c <C-R>=expand("<cword>")<CR><CR>:botright cw 7
elseif g:feat_enable_complete == 1 && g:complete_plugin_type.cur_val == "YouCompleteMe"
:YcmCompleter GoToReferences
else
call te#utils#EchoWarning("Enable lsp or youcompleteme")
endif
return 1
return 0
endfunction

0 comments on commit b78ea74

Please sign in to comment.