Merge pull request #240 from ShengYun/bugfix-wrong-sys-path-insert-with-space-paths

add expand to make paths which contains spaces work correctly
This commit is contained in:
Dave Halter
2014-01-02 11:35:34 -08:00

View File

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