Move powerline setup under :try

Makes it benefit from troubleshooting below
This commit is contained in:
ZyX 2014-08-24 13:27:52 +04:00
parent 2c8932b084
commit 6dde8f2f95
1 changed files with 7 additions and 10 deletions

View File

@ -60,16 +60,21 @@ function s:rcmd(s)
endif endif
endfunction endfunction
try try
let s:can_replace_pyeval = !exists('g:powerline_pyeval')
call s:rcmd("try:") call s:rcmd("try:")
call s:rcmd(" ".s:import_cmd."") call s:rcmd(" ".s:import_cmd."")
call s:rcmd("except ImportError:") call s:rcmd("except ImportError:")
call s:rcmd(" import sys, vim") call s:rcmd(" import sys, vim")
call s:rcmd(" sys.path.append(vim.eval('expand(\"<sfile>:h:h:h:h:h\")'))") call s:rcmd(" sys.path.append(vim.eval('expand(\"<sfile>:h:h:h:h:h\")'))")
call s:rcmd(" ".s:import_cmd."") call s:rcmd(" ".s:import_cmd."")
call s:rcmd("import vim")
call s:rcmd("VimPowerline().setup(pyeval=vim.eval('s:pyeval'), pycmd=vim.eval('s:pycmd'), can_replace_pyeval=int(vim.eval('s:can_replace_pyeval')))")
call s:rcmd("del VimPowerline")
execute s:pycmd s:pystr execute s:pycmd s:pystr
unlet s:pystr unlet s:pystr
let s:launched = 1 let s:launched = 1
finally finally
unlet s:can_replace_pyeval
unlet s:import_cmd unlet s:import_cmd
if !exists('s:launched') if !exists('s:launched')
unlet s:pystr unlet s:pystr
@ -126,15 +131,7 @@ finally
else else
unlet s:launched unlet s:launched
endif endif
unlet s:pycmd
unlet s:pyeval
delfunction s:rcmd delfunction s:rcmd
endtry endtry
let s:can_replace_pyeval = !exists('g:powerline_pyeval')
execute s:pycmd 'import vim'
execute s:pycmd 'VimPowerline().setup(pyeval=vim.eval("s:pyeval"), pycmd=vim.eval("s:pycmd"), can_replace_pyeval=int(vim.eval("s:can_replace_pyeval")))'
execute s:pycmd 'del VimPowerline'
unlet s:can_replace_pyeval
unlet s:pycmd
unlet s:pyeval