bootstrap: verify that g:UltiSnipsUsePythonVersion is available
Without this, UltiSnips will throw a lot of errors in case it's not available. This does not look at `g:UltiSnipsNoPythonWarning`, because it is not auto-detected, but provided by the user's config.
This commit is contained in:
parent
00848d7d64
commit
ac42c83a70
@ -20,10 +20,18 @@ function! UltiSnips#bootstrap#Bootstrap()
|
|||||||
endif
|
endif
|
||||||
let g:UltiSnipsUsePythonVersion = "<tab>"
|
let g:UltiSnipsUsePythonVersion = "<tab>"
|
||||||
else
|
else
|
||||||
if g:UltiSnipsUsePythonVersion == 2
|
" Use user-provided value, but check if it's available.
|
||||||
let g:_uspy=":py "
|
" This uses `has()`, because e.g. `exists(":python3")` is always 2.
|
||||||
else
|
if g:UltiSnipsUsePythonVersion == 2 && has('python')
|
||||||
let g:_uspy=":py3 "
|
let g:_uspy=":python "
|
||||||
|
elseif g:UltiSnipsUsePythonVersion == 3 && has('python3')
|
||||||
|
let g:_uspy=":python3 "
|
||||||
|
endif
|
||||||
|
if !exists('g:_uspy')
|
||||||
|
echohl WarningMsg
|
||||||
|
echom "UltiSnips: the Python version from g:UltiSnipsUsePythonVersion (".g:UltiSnipsUsePythonVersion.") is not available."
|
||||||
|
echohl None
|
||||||
|
return
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user