Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve auto-detect Snips support #298

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading