diff --git a/autoload/jedi.vim b/autoload/jedi.vim index 3289618..cbadb26 100644 --- a/autoload/jedi.vim +++ b/autoload/jedi.vim @@ -168,12 +168,6 @@ function! jedi#_vim_exceptions(str, is_eval) return l:result endfunction -if has('python') - command! -nargs=1 Python python -else - command! -nargs=1 Python python3 -end - " ------------------------------------------------------------------------ " deprecations " ------------------------------------------------------------------------ @@ -226,6 +220,21 @@ for [key, val] in items(s:settings) endfor +" ------------------------------------------------------------------------ +" Python initialization +" ------------------------------------------------------------------------ + +if has('python') + command! -nargs=1 Python python +elseif has('python3') + command! -nargs=1 Python python3 +else + if !exists("g:jedi#squelch_py_warning") + echomsg "Error: Required vim compiled with +python" + endif + finish +end + Python << PYTHONEOF """ here we initialize the jedi stuff """ import vim diff --git a/plugin/jedi.vim b/plugin/jedi.vim index 545d425..b77ff5d 100644 --- a/plugin/jedi.vim +++ b/plugin/jedi.vim @@ -1,28 +1,13 @@ "jedi.vim - Omni Completion for python in vim " Maintainer: David Halter " -" This part of the software is just the vim interface. The main source code -" lies in the python files around it. - -if !has('python') && !has('python3') - if !exists("g:jedi#squelch_py_warning") - echomsg "Error: Required vim compiled with +python" - endif - finish -endif - -" load plugin only once -if exists("g:loaded_jedi") || &cp - finish -endif -let g:loaded_jedi = 1 - +" This part of the software is just the vim interface. The really big deal is +" the Jedi Python library. if g:jedi#auto_vim_configuration filetype plugin on endif - " ------------------------------------------------------------------------ " PyImport command " ------------------------------------------------------------------------