Skip to content

Commit

Permalink
Merge pull request #65 from shaggyrogers/master
Browse files Browse the repository at this point in the history
[RFC] Improved auto preview
  • Loading branch information
dsummersl authored Nov 10, 2018
2 parents 2540b4f + 561803e commit a47b253
Show file tree
Hide file tree
Showing 9 changed files with 786 additions and 466 deletions.
45 changes: 24 additions & 21 deletions autoload/airline/extensions/mundo.vim
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
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
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', 'Mundo')
call builder.split()
call builder.add_section('airline_z', '%p%%')
return 1
endif
if &filetype == 'MundoDiff'
call builder.add_section('airline_a', 'Mundo Diff')
call builder.split()
return 1
endif
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')
call airline#add_statusline_func('airline#extensions#mundo#statusline')
call airline#add_inactive_statusline_func(
\ 'airline#extensions#mundo#inactive_statusline')
endfunction

Loading

0 comments on commit a47b253

Please sign in to comment.