I try to read :h errorformat:
%m error message (finds a string)
I try to read it, but I practically found that it's impossible to specify %m
twice:
E372: Too many %m in format string
I want to match ctest output, that looks like so:
1/1 Test #1: testname ...........***Failed Required regular expression not found.
I can match it with like:
:let &errorformat='%\d%\+/%\d%\+ Test #%l: %f %[.*]%#Failed %m'
and that will give me:
testname|1| Required regular expression not found.
This is no ideal, as it will try to open testname
file that does not exists. But I want to match Test #1: testname
and the message and remove the ....***Failed
part, so ideally, I would want like:
:let &errorformat='%\d%\+/%\d%\+ (Test #%l: %f)%m %[.*]%#Failed %m'
^^^^^^^^^^^^^^^^ like concatenates this to %m
Do I have to use an external tool (Filtering messages
section from :h errorformat
) (it will be sed
) or is it possible to get %m
twice and concatenate the message within vim errorformat?
%
item it looks like a direct approach is not feasible.