Vim: Error format matches all

I am trying to map the following error to efm:

AssertionError: 1 == 2
    at /home/strager/projects/blah/blah.js:13:37

The error message can be any (i.e. it does not always correspond to the formats AssertionError: .*or .*Error: .*). General format:

errormessage
    at filename:line:column

My problem is that the error message matches any line; I need to limit the error message to only one line and match only if it matches the match string ".".

I tried the following efm:

set efm=%Z\ \ \ \ at\ %f:%l:%c,%E%m
" %Z    at %f:%l:%c,%E%m

, (, - ) . %E%m ... %Z ( at)? UNIX makeprg, .

+5
3

, ? - vim, ( vim!). , , . :

#!/usr/bin/perl -w

use strict;

open my $fh, '-|', 'compiler', @_ or die $!;

my $last_line = <$fh> // exit;
while (defined(my $line = <$fh>)) {
    my($file, $l, $c) = $line =~ /^    at (.+?):(\d+):(\d+)$/;
    print "$file:$l:$c: $last_line" if defined($file);
    $last_line = $line;
}
+1

?

set efm=%Z\ \ \ \ at\ %f:%l:%c,%E%m,%-G%.%#

% -G%.% # vim , .

+1

...

set efm=%E%m,%Z\ \ \ \ at\ %f:%l:%c
0

All Articles