3

Consider the following 'errorformat' configuration:

set errorformat=%f:%l:\ %m

And the following message:

%Warning-ASSIGNDLY: test.v:1: Unsupported: Ignoring delay.

While I expected that this message would not match, for some reason, after running :make Vim is identifying this as a valid error message with the file name %Warning-ASSIGNDLY: test.v. My 'isfname' is with its default value (@,48-57,/,.,-,_,+,,,#,$,%,~), so I really don't understand how Vim is able to match a white space in the file name.

Any ideas?

2 Answers 2

5

As Tumbler41 notes, isfname has to be turned on:

If "%f" is followed by a '%' or a backslash, it will look for a sequence of 'isfname' characters.

I had no luck inserting a % (%: is an invalid format), but I succeeded with a backslash. This requires a second backslash to escape the first.

:set efm=%f\\:%l:\ %

Then set efm shows the single backslash:

errorformat=%f\:%l: %m 
1
  • 1
    The % following %f needs to be a part of the actual error format, so e.g. you can do set efm=%f%*[:]%l:%m. Apr 12, 2019 at 9:48
2

Disclaimer: I have never used errorformat before.

Edit: Deleted pointless stuff that was a mis-understanding of the question.

One other note. Earlier in the help doc it states:

If "%f" is followed by a '%' or a backslash, it will look for a sequence of 'isfname' characters.

Since yours doesn't, maybe that's why it can match a space?

As @JigglyNaga pointed out in the comments, make sure you use two back backslashes as without it set will try to escape the next character.

This is just my (non-expert) take on it. Hope it sparks something for you.

5
  • I had not tried appending the '%' or '\' before, but I just tried and it didn't help. I will also update my question explaining that I don't want to match this error message.
    – Vitor
    Jun 3, 2016 at 13:52
  • Ah, I see. Sorry about the mis-understanding.
    – Tumbler41
    Jun 3, 2016 at 13:59
  • Don't worry about that, thanks a lot for trying to help me!
    – Vitor
    Jun 3, 2016 at 13:59
  • 1
    @Vitor did you try appending two backslashes - one to escape the other from set?
    – JigglyNaga
    Jun 3, 2016 at 15:27
  • No I did not. And that does appear to work! :) Could you make it an answer, please?
    – Vitor
    Jun 3, 2016 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.