summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/prolog/swipl.vim16
1 files changed, 13 insertions, 3 deletions
diff --git a/ale_linters/prolog/swipl.vim b/ale_linters/prolog/swipl.vim
index 5c601c40..82859eb0 100644
--- a/ale_linters/prolog/swipl.vim
+++ b/ale_linters/prolog/swipl.vim
@@ -35,10 +35,11 @@ function! s:Subst(format, vars) abort
endfunction
function! ale_linters#prolog#swipl#Handle(buffer, lines) abort
- let l:pattern = '\v^(ERROR|Warning)+%(:\s*[^:]+:(\d+)%(:(\d+))?)?:\s*(.*)$'
let l:output = []
let l:i = 0
+ let l:pattern = '\v^(ERROR|Warning)+%(:\s*[^:]+:(\d+)%(:(\d+))?)?:\s*(.*)$'
+
while l:i < len(a:lines)
let l:match = matchlist(a:lines[l:i], l:pattern)
@@ -72,8 +73,17 @@ function! s:GetErrMsg(i, lines, text) abort
let l:i = a:i + 1
let l:text = []
- while l:i < len(a:lines) && a:lines[l:i] =~# '^\s'
- call add(l:text, s:Trim(a:lines[l:i]))
+ let l:pattern = '\v^(ERROR|Warning)?:?(.*)$'
+
+ while l:i < len(a:lines)
+ let l:match = matchlist(a:lines[l:i], l:pattern)
+
+ if empty(l:match) || empty(l:match[2])
+ let l:i += 1
+ break
+ endif
+
+ call add(l:text, s:Trim(l:match[2]))
let l:i += 1
endwhile