Merge pull request #1321 from chrisbra/getwininfo

Use getwininfo() for checking quickfix window
This commit is contained in:
Christian Brabandt 2016-12-09 12:59:46 +01:00 committed by GitHub
commit 781b4ea6a2
1 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,14 @@ function! airline#extensions#quickfix#inactive_qf_window(...)
endfunction endfunction
function! s:get_text() function! s:get_text()
if exists("*win_getid") && exists("*getwininfo")
let dict = getwininfo(win_getid())
if len(dict) > 0 && dict[0].quickfix && !dict[0].loclist
return g:airline#extensions#quickfix#quickfix_text
elseif len(dict) > 0 && dict[0].quickfix && dict[0].loclist
return g:airline#extensions#quickfix#location_text
endif
endif
redir => buffers redir => buffers
silent ls silent ls
redir END redir END
@ -43,4 +51,3 @@ function! s:get_text()
endfor endfor
return '' return ''
endfunction endfunction