-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from shaggyrogers/master
[RFC] Improved auto preview
- Loading branch information
Showing
9 changed files
with
786 additions
and
466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
Oops, something went wrong.