1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 10:20:05 +08:00

Fix formatter

This commit is contained in:
wsdjeg 2017-02-26 10:14:28 +08:00
parent 99f4d25042
commit d4e014eef1
2 changed files with 16 additions and 5 deletions

View File

@ -1,4 +1,11 @@
function! airline#extensions#tabline#formatters#spacevim#format(bufnr, buffers)
let id = SpaceVim#api#messletters#get().bubble_num(a:bufnr, 0)
return fnamemodify(bufname(a:bufnr), id . ':t')
function! airline#extensions#tabline#formatters#spacevim#format(bufnr, buffers) abort
let id = SpaceVim#api#messletters#get().bubble_num(a:bufnr, g:spacevim_buffer_index_type) . ' '
let fn = fnamemodify(bufname(a:bufnr), ':t')
if empty(fn)
return 'No Name'
elseif !g:airline#extensions#tabline#buffer_idx_mode
return id . fn
else
return fn
endif
endfunction

View File

@ -37,7 +37,7 @@ let g:airline#extensions#tabline#formatter = 'spacevim'
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#tabline#fnamecollapse = 1
let g:airline#extensions#tabline#fnametruncate = 0
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
"let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
@ -74,4 +74,8 @@ if get(g:, 'airline_powerline_fonts', 0)
let g:airline_symbols.linenr = ''
let g:airline_symbols.maxlinenr= ''
endif
let g:airline#extensions#tabline#show_tab_nr = 1
let g:airline#extensions#tabline#tab_nr_type= 2
let g:airline#extensions#tabline#show_tab_type = 1
let g:airline#extensions#tabline#buffers_label = 'BUFFERS'
let g:airline#extensions#tabline#tabs_label = 'TABS'