Use better name for powerline variable in global scope

It is completely possible that “pl” will be claimed by some other plugin
as well. There is no local scope for each .vim file in vim-python
interface.
This commit is contained in:
ZyX 2013-01-03 00:34:33 +04:00 committed by Kim Silkebækken
parent 7fb3df28b9
commit bfc29749c1
1 changed files with 4 additions and 4 deletions

View File

@ -1,18 +1,18 @@
python import uuid, vim python import uuid
python from powerline.core import Powerline python from powerline.core import Powerline
python pl = Powerline('vim') python powerline = Powerline('vim')
if exists('*pyeval') if exists('*pyeval')
let s:pyeval = function('pyeval') let s:pyeval = function('pyeval')
else else
python import json python import json, vim
function! s:pyeval(e) function! s:pyeval(e)
python vim.command('return ' + json.dumps(eval(vim.eval('a:e')))) python vim.command('return ' + json.dumps(eval(vim.eval('a:e'))))
endfunction endfunction
endif endif
function! Powerline(winnr, current) function! Powerline(winnr, current)
return s:pyeval('pl.renderer.render('. a:winnr .', '. a:current .')') return s:pyeval('powerline.renderer.render('. a:winnr .', '. a:current .')')
endfunction endfunction
function! s:UpdateWindows() function! s:UpdateWindows()