vim-dispatch icon indicating copy to clipboard operation
vim-dispatch copied to clipboard

s:open_quickfix also handles location list windows

Open blueyed opened this issue 9 years ago • 2 comments

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.

blueyed avatar Apr 08 '16 22:04 blueyed

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

blueyed avatar Apr 08 '16 23:04 blueyed

Just for reference: the following patch would help by having a buffer variable for it: https://github.com/neovim/neovim/issues/4550.

blueyed avatar Apr 09 '16 14:04 blueyed