s:open_quickfix also handles location list windows
There is only one quickfix window per tab, so a loop should not be necessary with https://github.com/tpope/vim-dispatch/blob/fc8d1e68cd58fb3ffdd56109bf855cda92b10b70/autoload/dispatch.vim#L851-L871.
On the other hand, there does not seem to be a way to find the quickfix window / distinguish it from the location list windows?!
The main issue here is that quickfix_title gets set for e.g. a Syntastic / Neomake location list then.
I've found something in vim-airline, which uses ls to get to that info (https://github.com/vim-airline/vim-airline/blob/master/autoload/airline/extensions/quickfix.vim#L20-L36):
function! s:get_text()
redir => buffers
silent ls
redir END
let nr = bufnr('%')
for buf in split(buffers, '\n')
if match(buf, '\v^\s*'.nr) > -1
if match(buf, '\cQuickfix') > -1
return g:airline#extensions#quickfix#quickfix_text
else
return g:airline#extensions#quickfix#location_text
endif
endif
endfor
return ''
endfunction
Just for reference: the following patch would help by having a buffer variable for it: https://github.com/neovim/neovim/issues/4550.