1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 05:40:05 +08:00
SpaceVim/bundle/vim-mundo/autoload/airline/extensions/mundo.vim
2020-10-31 15:52:34 +08:00

36 lines
1.0 KiB
VimL
Vendored

scriptencoding utf-8
function! airline#extensions#mundo#inactive_statusline(...)
let builder = a:1
if getwinvar(a:2.winnr, '&filetype') == 'Mundo'
return -1
endif
if getwinvar(a:2.winnr, '&filetype') == 'MundoDiff'
return 1
endif
endfunction
function! airline#extensions#mundo#statusline(...)
let builder = a:1
if &filetype == 'Mundo'
call builder.add_section('airline_a',
\ get(g:, 'mundo_tree_statusline', 'Mundo'))
call builder.split()
call builder.add_section('airline_z', '%p%%')
return 1
endif
if &filetype == 'MundoDiff'
call builder.add_section('airline_a',
\ get(g:, 'mundo_preview_statusline', 'Mundo Diff'))
call builder.split()
return 1
endif
endfunction
function! airline#extensions#mundo#init(...)
call airline#add_statusline_func('airline#extensions#mundo#statusline')
call airline#add_inactive_statusline_func(
\ 'airline#extensions#mundo#inactive_statusline')
endfunction