mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-25 15:04:44 +02:00
Use get() to access members of getwininfo() function
And add default value, in case the 'loclist' and 'quickfix' entry is not available (can happen on versions without +quickfix feature). Fixes #1379
This commit is contained in:
parent
9a95964256
commit
b56a064377
@ -29,9 +29,9 @@ endfunction
|
|||||||
function! s:get_text()
|
function! s:get_text()
|
||||||
if exists("*win_getid") && exists("*getwininfo")
|
if exists("*win_getid") && exists("*getwininfo")
|
||||||
let dict = getwininfo(win_getid())
|
let dict = getwininfo(win_getid())
|
||||||
if len(dict) > 0 && dict[0].quickfix && !dict[0].loclist
|
if len(dict) > 0 && get(dict[0], 'quickfix', 0) && !get(dict[0], 'loclist', 0)
|
||||||
return g:airline#extensions#quickfix#quickfix_text
|
return g:airline#extensions#quickfix#quickfix_text
|
||||||
elseif len(dict) > 0 && dict[0].quickfix && dict[0].loclist
|
elseif len(dict) > 0 && get(dict[0], 'quickfix', 0) && get(dict[0], 'loclist', 0)
|
||||||
return g:airline#extensions#quickfix#location_text
|
return g:airline#extensions#quickfix#location_text
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user