Skip to content

Commit 6d18d62

Browse files
committed
separate out vimtabs fragment as a public function
1 parent c7c5934 commit 6d18d62

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

autoload/wintabs/ui.vim

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" generate tabline, very straight forward
22
function! wintabs#ui#get_tabline()
3-
let spaceline = s:get_spaceline()
3+
let spaceline = [g:wintabs_renderers.line_sep(), s:get_spaceline()]
44
let bufline = s:truncate_line(
55
\0,
66
\s:get_bufline(0),
@@ -43,6 +43,11 @@ function! wintabs#ui#reset_statusline(window)
4343
return ''
4444
endfunction
4545

46+
" public function to expose fragment for vimtabs
47+
function! wintabs#ui#get_vimtabs_fragment()
48+
return wintabs#element#render(s:get_spaceline())
49+
endfunction
50+
4651
" private functions below
4752

4853
" generate bufline per window
@@ -239,7 +244,7 @@ function! s:get_spaceline()
239244
return ['', 0]
240245
endif
241246

242-
let line = [g:wintabs_renderers.line_sep()]
247+
let line = []
243248
let active_index = tabpagenr()
244249

245250
for tab in range(1, spaces)

doc/wintabs.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ default: value of |statusline| option
211211
content to tabline.
212212
By default, this option is set to what 'original statusline'
213213
is. If vim-airline is installed, airline#statusline() is used.
214+
Set this option to a custom function like "%!MyStatusline()"
215+
if you want to show complex and customized status on tabline.
214216
Set this option to empty string to disable this behavior.
215217

216218
*g:wintabs_ignored_filetypes*

0 commit comments

Comments
 (0)