mirror of
https://github.com/powerline/powerline.git
synced 2025-07-27 07:44:36 +02:00
parent
f877516e54
commit
120a9cc8fa
@ -15,6 +15,7 @@
|
|||||||
"single_tab": "line_current",
|
"single_tab": "line_current",
|
||||||
"many_tabs": "line_current",
|
"many_tabs": "line_current",
|
||||||
"bufnr": "information:unimportant",
|
"bufnr": "information:unimportant",
|
||||||
|
"winnr": "information:unimportant",
|
||||||
"tabnr": "file_directory"
|
"tabnr": "file_directory"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -516,6 +516,18 @@ def bufnr(pl, segment_info, show_current=False):
|
|||||||
return str(bufnr)
|
return str(bufnr)
|
||||||
|
|
||||||
|
|
||||||
|
@requires_segment_info
|
||||||
|
def winnr(pl, segment_info, show_current=False):
|
||||||
|
'''Show window number
|
||||||
|
|
||||||
|
:param bool show_current:
|
||||||
|
If False do not show current window number.
|
||||||
|
'''
|
||||||
|
winnr = segment_info['winnr']
|
||||||
|
if show_current or winnr != vim.current.window.number:
|
||||||
|
return str(winnr)
|
||||||
|
|
||||||
|
|
||||||
def single_tab(pl, single_text='Bufs', multiple_text='Tabs'):
|
def single_tab(pl, single_text='Bufs', multiple_text='Tabs'):
|
||||||
'''Show one text if there is only one tab and another if there are many
|
'''Show one text if there is only one tab and another if there are many
|
||||||
|
|
||||||
|
@ -799,6 +799,12 @@ class TestVim(TestCase):
|
|||||||
self.assertEqual(vim.bufnr(pl=pl, segment_info=segment_info, show_current=True), str(segment_info['bufnr']))
|
self.assertEqual(vim.bufnr(pl=pl, segment_info=segment_info, show_current=True), str(segment_info['bufnr']))
|
||||||
self.assertEqual(vim.bufnr(pl=pl, segment_info=segment_info, show_current=False), None)
|
self.assertEqual(vim.bufnr(pl=pl, segment_info=segment_info, show_current=False), None)
|
||||||
|
|
||||||
|
def test_winnr(self):
|
||||||
|
pl = Pl()
|
||||||
|
segment_info = vim_module._get_segment_info()
|
||||||
|
self.assertEqual(vim.winnr(pl=pl, segment_info=segment_info, show_current=True), str(segment_info['winnr']))
|
||||||
|
self.assertEqual(vim.winnr(pl=pl, segment_info=segment_info, show_current=False), None)
|
||||||
|
|
||||||
def test_single_tab(self):
|
def test_single_tab(self):
|
||||||
pl = Pl()
|
pl = Pl()
|
||||||
single_tab = partial(vim.single_tab, pl=pl)
|
single_tab = partial(vim.single_tab, pl=pl)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user