summaryrefslogtreecommitdiff
path: root/ale_linters/perl/perl.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-06-06 20:37:04 +0100
committerw0rp <devw0rp@gmail.com>2017-06-06 20:40:07 +0100
commiteeea72e16740bb1dfa5bd554a927e6bbee76a9b5 (patch)
tree69cf426eb9fe7a16f4f75455f7ac398c5b716d75 /ale_linters/perl/perl.vim
parent7db805b0cd1367ebf866e0c149fd819e425f6e0d (diff)
downloadale-eeea72e16740bb1dfa5bd554a927e6bbee76a9b5.zip
Fix #625 Ignore Perl errors from other files
Diffstat (limited to 'ale_linters/perl/perl.vim')
-rw-r--r--ale_linters/perl/perl.vim14
1 files changed, 9 insertions, 5 deletions
diff --git a/ale_linters/perl/perl.vim b/ale_linters/perl/perl.vim
index ab4defbc..53c91d36 100644
--- a/ale_linters/perl/perl.vim
+++ b/ale_linters/perl/perl.vim
@@ -20,17 +20,21 @@ endfunction
function! ale_linters#perl#perl#Handle(buffer, lines) abort
let l:pattern = '\(.\+\) at \(.\+\) line \(\d\+\)'
let l:output = []
+ let l:basename = expand('#' . a:buffer . ':t')
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:line = l:match[3]
let l:text = l:match[1]
let l:type = 'E'
- call add(l:output, {
- \ 'lnum': l:line,
- \ 'text': l:text,
- \ 'type': l:type,
- \})
+ if l:match[2][-len(l:basename):] ==# l:basename
+ \&& l:text !=# 'BEGIN failed--compilation aborted'
+ call add(l:output, {
+ \ 'lnum': l:line,
+ \ 'text': l:text,
+ \ 'type': l:type,
+ \})
+ endif
endfor
return l:output