Skip to content

Commit

Permalink
Merge pull request #298 from phongnh/auto-detect-snips-support
Browse files Browse the repository at this point in the history
Improve auto-detect Snips support
  • Loading branch information
jayli authored Oct 24, 2024
2 parents 807e8ee + 38fa57d commit 3e07efa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
10 changes: 1 addition & 9 deletions autoload/easycomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2021,15 +2021,7 @@ function! easycomplete#SnipSupports()
endfunction

function! s:SnipSupports()
if !has("python3")
return v:false
endif
try
call funcref("UltiSnips#SnippetsInCurrentScope")
catch /700/
return v:false
endtry
return v:true
return g:easycomplete_snips_enable ? v:true : v:false
endfunction

function! s:SnippetsInit()
Expand Down
3 changes: 3 additions & 0 deletions plugin/easycomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ endif
if !exists("g:easycomplete_tabnine_config")
let g:easycomplete_tabnine_config = {}
endif
if !exists("g:easycomplete_snips_enable")
let g:easycomplete_snips_enable = has('python3') && exists('*UltiSnips#SnippetsInCurrentScope')
endif
if !exists("g:easycomplete_filetypes")
let g:easycomplete_filetypes = {"r": {
\ "whitelist": []
Expand Down

0 comments on commit 3e07efa

Please sign in to comment.