Use ternary-operator

This commit is contained in:
Hana Shiro 2018-06-02 13:02:49 +08:00
parent 08570b6dcb
commit 92bf1b0b39

View File

@ -26,11 +26,9 @@ function! airline#extensions#tabline#ctrlspace#invalidate()
endfunction
function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, pos)
if a:pos == 0
let pos_extension = ''
else
let pos_extension = '_right'
endif
let pos_extension = (a:pos == 0)
\ ? ''
\ : '_right'
let s:buffer_list = ctrlspace#api#BufferList(a:cur_tab)
" add by tenfy(tenfyzhong@qq.com)
@ -74,11 +72,9 @@ function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_t
endfunction
function! airline#extensions#tabline#ctrlspace#add_tab_section(builder, pos)
if a:pos == 0
let pos_extension = ''
else
let pos_extension = '_right'
endif
let pos_extension = (a:pos == 0)
\ ? ''
\ : '_right'
for tab in s:tab_list
if tab.current