Fix return value of vim_getbufoption, use new command-t matcher

Now it uses _vim_to_python to transform its return value. Should fix tests.
This commit is contained in:
Foo 2016-03-22 15:23:25 +03:00
parent a44c9a8ec9
commit 5c8b52bc34
3 changed files with 8 additions and 5 deletions

View File

@ -273,7 +273,7 @@ def _vim_to_python(value):
if hasattr(vim, 'options'):
def vim_getbufoption(info, option):
return info['buffer'].options[str(option)]
return _vim_to_python(info['buffer'].options[str(option)])
def vim_getoption(option):
return vim.options[str(option)]

View File

@ -7,7 +7,7 @@ from powerline.bindings.vim import vim_getbufoption, buffer_name
def help(matcher_info):
return str(vim_getbufoption(matcher_info, 'buftype')) == 'help'
return vim_getbufoption(matcher_info, 'buftype') == 'help'
def cmdwin(matcher_info):
@ -16,4 +16,4 @@ def cmdwin(matcher_info):
def quickfix(matcher_info):
return str(vim_getbufoption(matcher_info, 'buftype')) == 'quickfix'
return vim_getbufoption(matcher_info, 'buftype') == 'quickfix'

View File

@ -3,9 +3,12 @@ from __future__ import (unicode_literals, division, absolute_import, print_funct
import os
from powerline.bindings.vim import buffer_name
from powerline.bindings.vim import vim_getbufoption, buffer_name
def commandt(matcher_info):
name = buffer_name(matcher_info)
return name and os.path.basename(name) == b'GoToFile'
return (
vim_getbufoption(matcher_info, 'filetype') == 'command-t'
or (name and os.path.basename(name) == b'GoToFile')
)