Fix name conflict in vim bindings

This commit is contained in:
ZyX 2014-08-10 16:32:27 +04:00
parent 9d1392fa0d
commit 5313e61fe6

View File

@ -155,7 +155,7 @@ class VimPowerline(Powerline):
# requirements to __main__ globals to just one powerline object # requirements to __main__ globals to just one powerline object
# (previously it required as well vim and json) # (previously it required as well vim and json)
@staticmethod @staticmethod
def pyeval(): def do_pyeval():
import __main__ import __main__
vim.command('return ' + json.dumps(eval(vim.eval('a:e'), vim.command('return ' + json.dumps(eval(vim.eval('a:e'),
__main__.__dict__))) __main__.__dict__)))
@ -199,7 +199,7 @@ def setup(pyeval=None, pycmd=None, can_replace_pyeval=True):
if not hasattr(vim, 'bindeval') and can_replace_pyeval: if not hasattr(vim, 'bindeval') and can_replace_pyeval:
vim.command((''' vim.command(('''
function! PowerlinePyeval(e) function! PowerlinePyeval(e)
{pycmd} powerline.pyeval() {pycmd} powerline.do_pyeval()
endfunction endfunction
''').format(pycmd=pycmd)) ''').format(pycmd=pycmd))
pyeval = 'PowerlinePyeval' pyeval = 'PowerlinePyeval'