mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-21 13:04:54 +02:00
Merge pull request #2402 from vim-airline/add-patch-1
[refactor] use Ternary operator
This commit is contained in:
commit
a94d8034c3
@ -76,17 +76,14 @@ else
|
|||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! airline#extensions#default#apply(builder, context)
|
function! airline#extensions#default#apply(builder, context) abort
|
||||||
let winnr = a:context.winnr
|
let winnr = a:context.winnr
|
||||||
let active = a:context.active
|
let active = a:context.active
|
||||||
|
|
||||||
if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse))
|
if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse))
|
||||||
call s:build_sections(a:builder, a:context, s:layout[0])
|
call s:build_sections(a:builder, a:context, s:layout[0])
|
||||||
else
|
else
|
||||||
let text = s:get_section(winnr, 'c')
|
let text = !empty(s:get_section(winnr, 'c')) ? s:get_section(winnr, 'c') : ' %f%m '
|
||||||
if empty(text)
|
|
||||||
let text = ' %f%m '
|
|
||||||
endif
|
|
||||||
call a:builder.add_section('airline_c'.(a:context.bufnr), text)
|
call a:builder.add_section('airline_c'.(a:context.bufnr), text)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user