Merge branch 'feature/vim-special-windows' into develop

This commit is contained in:
Kim Silkebækken 2013-04-11 11:53:05 +02:00
commit a1f370490b
4 changed files with 43 additions and 2 deletions

View File

@ -36,7 +36,8 @@
"theme": "default", "theme": "default",
"local_themes": { "local_themes": {
"cmdwin": "cmdwin", "cmdwin": "cmdwin",
"help": "help" "help": "help",
"quickfix": "quickfix"
} }
}, },
"wm": { "wm": {

View File

@ -0,0 +1,36 @@
{
"segment_data": {
"file_name": {
"contents": "Location List"
}
},
"segments": {
"left": [
{
"type": "string",
"name": "file_name",
"draw_soft_divider": false
},
{
"type": "string",
"highlight_group": ["background"],
"draw_soft_divider": false,
"draw_hard_divider": false,
"width": "auto"
}
],
"right": [
{
"type": "string",
"name": "line_current_symbol",
"highlight_group": ["line_current_symbol", "line_current"]
},
{
"name": "line_current",
"draw_soft_divider": false,
"width": 3,
"align": "r"
}
]
}
}

View File

@ -13,3 +13,7 @@ def help(matcher_info):
def cmdwin(matcher_info): def cmdwin(matcher_info):
name = matcher_info['buffer'].name name = matcher_info['buffer'].name
return name and os.path.basename(name) == '[Command Line]' return name and os.path.basename(name) == '[Command Line]'
def quickfix(matcher_info):
return str(getbufvar(matcher_info['bufnr'], '&buftype')) == 'quickfix'

View File

@ -19,7 +19,7 @@ class TestConfig(TestCase):
def test_vim(self): def test_vim(self):
from powerline.vim import VimPowerline from powerline.vim import VimPowerline
cfg_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'powerline', 'config_files') cfg_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'powerline', 'config_files')
buffers = ((('bufoptions',), {'buftype': 'help'}), (('buffer', '[Command Line]'), {})) buffers = ((('bufoptions',), {'buftype': 'help'}), (('buffer', '[Command Line]'), {}), (('bufoptions',), {'buftype': 'quickfix'}))
with open(os.path.join(cfg_path, 'config.json'), 'r') as f: with open(os.path.join(cfg_path, 'config.json'), 'r') as f:
self.assertEqual(len(buffers), len(json.load(f)['ext']['vim']['local_themes'])) self.assertEqual(len(buffers), len(json.load(f)['ext']['vim']['local_themes']))
outputs = {} outputs = {}