diff --git a/autoload/airline/builder.vim b/autoload/airline/builder.vim index 2d38ba12..25f510b6 100644 --- a/autoload/airline/builder.vim +++ b/autoload/airline/builder.vim @@ -11,11 +11,11 @@ endfunction function! s:prototype.add_section(group, contents) if self._curgroup != '' if self._curgroup == a:group - let self._line .= self._side ? g:airline_left_alt_sep : g:airline_right_alt_sep + let self._line .= self._side ? self._context.left_alt_sep : self._context.right_alt_sep else call airline#highlighter#add_separator(self._curgroup, a:group, self._side) let self._line .= '%#'.self._curgroup.'_to_'.a:group.'#' - let self._line .= self._side ? g:airline_left_sep : g:airline_right_sep + let self._line .= self._side ? self._context.left_sep : self._context.right_sep endif endif @@ -40,6 +40,13 @@ function! airline#builder#new(context) let builder._side = 1 let builder._curgroup = '' let builder._line = '' + + call extend(builder._context, { + \ 'left_sep': g:airline_left_sep, + \ 'left_alt_sep': g:airline_left_alt_sep, + \ 'right_sep': g:airline_right_sep, + \ 'right_alt_sep': g:airline_right_alt_sep, + \ }, 'keep') return builder endfunction diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 14103328..12188cd2 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -8,6 +8,14 @@ let s:buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0) let s:buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ') let s:buf_modified_symbol = g:airline_symbols.modified +let s:builder_context = { + \ 'active' : 1, + \ 'left_sep' : get(g:, 'airline#extensions#tabline#left_sep' , g:airline_left_sep), + \ 'left_alt_sep' : get(g:, 'airline#extensions#tabline#left_alt_sep' , g:airline_left_alt_sep), + \ 'right_sep' : get(g:, 'airline#extensions#tabline#right_sep' , g:airline_right_sep), + \ 'right_alt_sep' : get(g:, 'airline#extensions#tabline#right_alt_sep', g:airline_right_alt_sep), + \ } + function! airline#extensions#tabline#init(ext) if has('gui_running') set guioptions-=e @@ -68,7 +76,7 @@ function! airline#extensions#tabline#get_buffer_name(nr) endfunction function! s:get_buffers() - let b = airline#builder#new({'active': 1}) + let b = airline#builder#new(s:builder_context) let cur = bufnr('%') for nr in range(1, bufnr('$')) if buflisted(nr) && bufexists(nr) @@ -96,7 +104,7 @@ function! s:get_buffers() endfunction function! s:get_tabs() - let b = airline#builder#new({'active': 1}) + let b = airline#builder#new(s:builder_context) for i in range(1, tabpagenr('$')) let group = i == tabpagenr() ? 'airline_tabsel' : 'airline_tab' let val = '%(' diff --git a/doc/airline.txt b/doc/airline.txt index c79badd9..abe8ce0e 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -312,6 +312,12 @@ virtualenv * configure how buffer numbers should be formatted with |printf|. > let g:airline#extensions#tabline#buffer_nr_format = '%s: ' < +* configure separators for the tabline only. > + let g:airline#extensions#tabline#left_sep = '' + let g:airline#extensions#tabline#left_alt_sep = '' + let g:airline#extensions#tabline#right_sep = '' + let g:airline#extensions#tabline#right_alt_sep = '' +< Note: Enabling this extension will modify |showtabline| and |guioptions|. ==============================================================================