Load only default/forced py_version, changed names and variable type

1. Changed pycmd: renamed to py_version, changed type, resulting in
...#force_py_version = <int> (2 or 3)
2. Changed structure of initialization, changes broke functionality
(<sfile> behaviour changes inside a function)
3. Cleaned up.
This commit is contained in:
Asa Jay
2013-12-15 17:01:28 +01:00
parent 3ad63c9458
commit b1205ce779
3 changed files with 34 additions and 36 deletions

View File

@@ -9,14 +9,15 @@ import vim
import sys
import os
# vim.command('echom expand("<sfile>:p:h:h")')
sys.path.insert(0, os.path.join(vim.eval('expand("<sfile>:p:h:h")'), 'jedi'))
# vim.command('echom expand("<sfile>:p:h:h")') # broken, <sfile> inside function
# sys.path.insert(0, os.path.join(vim.eval('expand("<sfile>:p:h:h")'), 'jedi'))
sys.path.insert(0, os.path.join(vim.eval('s:script_path'), 'jedi'))
# to display errors correctly
import traceback
# update the sys path to include the jedi_vim script
sys.path.insert(1, vim.eval('expand("<sfile>:p:h:h")'))
sys.path.insert(0, vim.eval('s:script_path'))
try:
import jedi_vim
except ImportError: