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

[READY] Fix errors with Vim versions prior to 7.4.107 when UltiSnips is not loaded #2337

Closed
wants to merge 1 commit into from
Closed
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: 10 additions & 0 deletions python/ycm/youcompleteme.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,16 @@ def BuildExtraConfData( extra_conf_vim_data ):

def _AddUltiSnipsDataIfNeeded( self, extra_data ):
# See :h UltiSnips#SnippetsInCurrentScope.

# Errors when evaluating Vim expressions are not caught by Python
# try/except blocks prior to Vim 7.4.107. We check that the UltiSnips
# function exists for these versions.
# TODO: remove this when bumping version requirement to 7.4.107 or greater.
if ( not vimsupport.VimVersionAtLeast( "7.4.107" ) and
not vimsupport.GetBoolValue(
"exists( '*UltiSnips#SnippetsInCurrentScope' )" ) ):
return

try:
vim.eval( 'UltiSnips#SnippetsInCurrentScope( 1 )' )
except vim.error:
Expand Down