Merge pull request #1553 from ZyX-I/fix-ct-tests

Fix command-t tests
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2016-04-08 20:58:12 +03:00
commit 77322aeaf2
4 changed files with 8 additions and 9 deletions

View File

@ -27,10 +27,6 @@ matrix:
- python: "3.5" - python: "3.5"
- python: "pypy" - python: "pypy"
- python: "pypy3" - python: "pypy3"
- python: "2.6"
env: >-
USE_UCS2_PYTHON=1
UCS2_PYTHON_VARIANT="2.6"
- python: "2.7" - python: "2.7"
env: >- env: >-
USE_UCS2_PYTHON=1 USE_UCS2_PYTHON=1

View File

@ -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)]

View File

@ -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'

View File

@ -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')
)