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:
parent
a44c9a8ec9
commit
5c8b52bc34
|
@ -273,7 +273,7 @@ def _vim_to_python(value):
|
||||||
|
|
||||||
if hasattr(vim, 'options'):
|
if hasattr(vim, 'options'):
|
||||||
def vim_getbufoption(info, option):
|
def vim_getbufoption(info, option):
|
||||||
return info['buffer'].options[str(option)]
|
return _vim_to_python(info['buffer'].options[str(option)])
|
||||||
|
|
||||||
def vim_getoption(option):
|
def vim_getoption(option):
|
||||||
return vim.options[str(option)]
|
return vim.options[str(option)]
|
||||||
|
|
|
@ -7,7 +7,7 @@ from powerline.bindings.vim import vim_getbufoption, buffer_name
|
||||||
|
|
||||||
|
|
||||||
def help(matcher_info):
|
def help(matcher_info):
|
||||||
return str(vim_getbufoption(matcher_info, 'buftype')) == 'help'
|
return vim_getbufoption(matcher_info, 'buftype') == 'help'
|
||||||
|
|
||||||
|
|
||||||
def cmdwin(matcher_info):
|
def cmdwin(matcher_info):
|
||||||
|
@ -16,4 +16,4 @@ def cmdwin(matcher_info):
|
||||||
|
|
||||||
|
|
||||||
def quickfix(matcher_info):
|
def quickfix(matcher_info):
|
||||||
return str(vim_getbufoption(matcher_info, 'buftype')) == 'quickfix'
|
return vim_getbufoption(matcher_info, 'buftype') == 'quickfix'
|
||||||
|
|
|
@ -3,9 +3,12 @@ from __future__ import (unicode_literals, division, absolute_import, print_funct
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from powerline.bindings.vim import buffer_name
|
from powerline.bindings.vim import vim_getbufoption, buffer_name
|
||||||
|
|
||||||
|
|
||||||
def commandt(matcher_info):
|
def commandt(matcher_info):
|
||||||
name = buffer_name(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')
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue