Hi,
I'm writing a script that will allow for what I feel is a more
comfortable :make + :copen behaviour. Essentially what I am writing is
a function that will run :make!, and check if there are errors. If
errors are present, it will open a new tab and :copen the quickfix at
the bottom of that window. The hope here is that I can browse errors
solely using the window above the quickfix window, and not alter any
other windows that I currently have open.
So far, I have the following, very simple behaviour, which will check
for any errors and open the new tab & quickfix if appropriate:
function! MakeWithCopen()
make!
let qflist = getqflist()
for e in qflist
if e.valid
tabnew
copen
break
endif
endfor
endfunction
If the error happens to be in a file that I don't have visible in
another window, I get the behaviour that I want. The issue is that
when I do have it open in another window, it flips to that tab and
moves me around in my buffer.
I have tried setting qflist.bufnr = 0, as the documentation says that
is the value for an error if there is no open buffer, but then the
quickfix widow doesn't recognize any of the errors as being errors
anymore.
Does anyone have any ideas of what I can do to have the quickfix
window default to display the buffer in the window above it, rather
than the already opened window?
Any help is greatly appreciated!
Marc
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php