windowswap: use new tab-aware API if WS is current

This commit is contained in:
Wes Malone 2016-03-16 19:26:44 -05:00
parent 410429a95c
commit 582958d6c5
1 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,11 @@ function! airline#extensions#windowswap#init(ext)
endfunction
function! airline#extensions#windowswap#get_status()
if WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr()
" use new tab-aware api if WS is up to date
let s:mark = exists('*WindowSwap#IsCurrentWindowMarked') ?
\WindowSwap#IsCurrentWindowMarked() :
\(WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr())
if s:mark
return g:airline#extensions#windowswap#indicator_text.s:spc
endif
return ''