Do not barf more than once when python is not found. Patch by blueyed.
This commit is contained in:
commit
15f39c0801
@ -8,14 +8,30 @@ endif
|
|||||||
let did_UltiSnips_autoload=1
|
let did_UltiSnips_autoload=1
|
||||||
|
|
||||||
" Define dummy version of function called by autocommand setup in
|
" Define dummy version of function called by autocommand setup in
|
||||||
" ftdetect/UltiSnips.vim. If the function isn't defined (probably due to
|
" ftdetect/UltiSnips.vim and plugin/UltiSnips.vim.
|
||||||
" using a copy of vim without python support) it will cause an error anytime a
|
" If the function isn't defined (probably due to using a copy of vim
|
||||||
" new file is opened.
|
" without python support) it would cause an error.
|
||||||
function! UltiSnips#FileTypeChanged()
|
function! UltiSnips#FileTypeChanged()
|
||||||
endfunction
|
endfunction
|
||||||
|
function! UltiSnips#CursorMoved()
|
||||||
|
endfunction
|
||||||
|
function! UltiSnips#CursorMoved()
|
||||||
|
endfunction
|
||||||
|
function! UltiSnips#LeavingBuffer()
|
||||||
|
endfunction
|
||||||
|
function! UltiSnips#LeavingInsertMode()
|
||||||
|
endfunction
|
||||||
|
|
||||||
call UltiSnips#bootstrap#Bootstrap()
|
call UltiSnips#bootstrap#Bootstrap()
|
||||||
if !exists("g:_uspy")
|
if !exists("g:_uspy")
|
||||||
|
" Delete the autocommands defined in plugin/UltiSnips.vim and
|
||||||
|
" ftdetect/UltiSnips.vim.
|
||||||
|
augroup UltiSnips
|
||||||
|
au!
|
||||||
|
augroup END
|
||||||
|
augroup UltiSnipsFileType
|
||||||
|
au!
|
||||||
|
augroup END
|
||||||
finish
|
finish
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ function! UltiSnips#bootstrap#Bootstrap()
|
|||||||
echo "UltiSnips requires py >= 2.6 or any py3"
|
echo "UltiSnips requires py >= 2.6 or any py3"
|
||||||
endif
|
endif
|
||||||
unlet g:_uspy
|
unlet g:_uspy
|
||||||
finish
|
return
|
||||||
endif
|
endif
|
||||||
let g:_uspy=":py "
|
let g:_uspy=":py "
|
||||||
endif
|
endif
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
call UltiSnips#bootstrap#Bootstrap()
|
call UltiSnips#bootstrap#Bootstrap()
|
||||||
|
|
||||||
function! UltiSnips#map_keys#MapKeys()
|
function! UltiSnips#map_keys#MapKeys()
|
||||||
|
if !exists('g:_uspy')
|
||||||
|
" Do not map keys if bootstrapping failed (e.g. no Python).
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
" Map the keys correctly
|
" Map the keys correctly
|
||||||
if g:UltiSnipsExpandTrigger == g:UltiSnipsJumpForwardTrigger
|
if g:UltiSnipsExpandTrigger == g:UltiSnipsJumpForwardTrigger
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
" This has to be called before ftplugins are loaded. Therefore
|
" This has to be called before ftplugins are loaded. Therefore
|
||||||
" it is here in ftdetect though it maybe shouldn't
|
" it is here in ftdetect though it maybe shouldn't
|
||||||
if has("autocmd")
|
if has("autocmd")
|
||||||
|
augroup UltiSnipsFileType
|
||||||
|
au!
|
||||||
autocmd FileType * call UltiSnips#FileTypeChanged()
|
autocmd FileType * call UltiSnips#FileTypeChanged()
|
||||||
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
@ -57,10 +57,13 @@ function! UltiSnips_Anon(...)
|
|||||||
return call(function('UltiSnips#Anon'), a:000)
|
return call(function('UltiSnips#Anon'), a:000)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
augroup UltiSnips
|
||||||
|
au!
|
||||||
au CursorMovedI * call UltiSnips#CursorMoved()
|
au CursorMovedI * call UltiSnips#CursorMoved()
|
||||||
au CursorMoved * call UltiSnips#CursorMoved()
|
au CursorMoved * call UltiSnips#CursorMoved()
|
||||||
au BufLeave * call UltiSnips#LeavingBuffer()
|
au BufLeave * call UltiSnips#LeavingBuffer()
|
||||||
au InsertLeave * call UltiSnips#LeavingInsertMode()
|
au InsertLeave * call UltiSnips#LeavingInsertMode()
|
||||||
|
augroup END
|
||||||
|
|
||||||
call UltiSnips#map_keys#MapKeys()
|
call UltiSnips#map_keys#MapKeys()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user