Friday, October 10, 2014

Building the quickfix window from VimL

7.4.1-466  Windows 7 32 bit

I have a plugin with formats some code.

But in order to format it, it has to parse it.
During the parsing, it can report errors.

I want to basically open the quickfix window and give the usual output you would usually supply with a :make.

So I create a new buffer.
:setlocal filetype=qf

Put in some content:
myfile.txt,3,134,some error message

Set the errorformat:
setlocal errorformat=%f,%l,%c,%m

But the buffer never turns into what I expect with the quickfix window.
It remains as text, rather than turning into the expect (syntax is slightly different) I can click on the line and it takes me to myfile.txt (different buffer) to the line and column specified in the error.

Here are the actual commands I am executing:
setlocal nowrap
setlocal noswapfile
setlocal nonumber
setlocal bufhidden=wipe
setlocal errorformat=%f,%l,%c,%m
setlocal filetype=qf
<paste the text>
myfile.txt,3,134,some error message
setlocal nomodified

Do I just have the errorformat wrong (it is a pretty simple one in this case), which is stopping this from working or something else?

Also, assuming I get my new buffer to turn into a quickfix window properly, when I hit enter on the line, the filename is "myfile.txt" does Vim just look for an already open buffer with that name and switch to it or do I have to link this new quickfix buffer to my already open buffer?

Thanks for any help.
David



--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: