Problem: When using the gcc "compiler" setting under Linux and you
need to find warnings or errors in the quicklist via the vimscript
getqflist()....... THERE ARE NONE!
Note: It seems that the errorformat string for gcc doesn't specify
flagging either Warnings or Errors for the quickfixlist. You only get
a list of strings output by gcc. While they are in fact either
warnings or errors, Vim only sees them as raw messages.
Solution: Add the appropriate lines into the gcc "compiler" setting to
Here is my proposed fix (can it be included into Vim 7.3?):
" Vim compiler file
" Compiler: GNU C Compiler
" Maintainer: Nikolai Weibull <[hidden email]>
" Latest Revision: 2010-5-20
let current_compiler = "gcc"
I made Vim place signs after doing a ":make" command (ends up looking
a bit like Eclipse or Visual Studio) by parsing the list returned by
getqflist(), but I soon discovered that Vim didn't know there were any
warnings or errors to look for. While the getqflist() function
returned a list, the "type" of entry in a qflist was nonexistent.
To see an example of this, type ":make" and when it finishes, type
":echo getqflist()". If you look for "'type' : " you'll see that it
has nothing associated with it.
So, I added the two lines that you indicated to the gcc "compiler"
file to resolve the issue. Now, after I do a ":make", I have
correctly placed signs throughout the editor (looking for type = "w"
or "e"). As a bonus, any errors coming from ":make" are now
highlighted in the ErrMsg highlight group, which I wasn't expecting.
I'm referring to the use of ":cw" here and it's displayed window.
I figured the change wouldn't hurt anything since most people
(including myself until recently) just look at the output of ":make"
and probably don't use Vim scripts for automating that process.
Let me know if the change seems useful!
On Thu, May 27, 2010 at 2:45 PM, Nikolai Weibull <[hidden email]> wrote:
> On Thu, May 27, 2010 at 15:32, David Harrison
> <[hidden email]> wrote:
>> Solution: Add the appropriate lines into the gcc "compiler" setting to
>> flag warnings/errors.
> What gain does this provide, exactly? (To everyone who worries that
> I’m in some way against this: I’m not against this, I just want to
>> Here is my proposed fix (can it be included into Vim 7.3?):
> Please send a patch. I assume that it’s only the addition of
> \%f:%l:\ %tarning:\ %m,
> \%f:%l:\ %trror:\ %m,
> that’s necessary, correct?
You received this message from the "vim_dev" 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