With vim errorformat syntax, is there a way to use part of a message when filtering results?
As an example, some linker errors do not have anything explicit to distinguish them from line errors except for the error itself:
/path/to/foo.cpp:42: undefined reference to 'UnimplementedFunction'
or
/path/to/foo.cpp:43: multiple definition of 'MultiplyDefinedFunction'
Using the error format:
set efm=%f:%l:\ %m
will catch and display both of them correctly, but it will falsely match many other cases (any line starting with "[line]: [number]:").
Or, explicitly indicating both of them:
set efm= set efm+=%f:%l:\ undefined\ reference\ to\ %m set efm+=%f:%l:\ multiple\ definition\ of\ %m
removes false positives, but the βmessageβ becomes much less useful - the actual error is no longer included (just what is after it).
Is there anything in the syntax that I am missing to handle this situation?
Ideally, I would like to say something like:
set efm+=%f:%l:\ %{StartMessage}undefined\ reference\ to\ %*\\S%{EndMessage} set efm+=%f:%l:\ %{StartMessage}multiple\ definition\ of\ %*\\S%{EndMessage}
... where all the match between StartMessage and EndMessage is used as an error message.
source share