summaryrefslogtreecommitdiff
path: root/ale_linters/powershell/powershell.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/powershell/powershell.vim')
-rwxr-xr-xale_linters/powershell/powershell.vim22
1 files changed, 15 insertions, 7 deletions
diff --git a/ale_linters/powershell/powershell.vim b/ale_linters/powershell/powershell.vim
index 51ded71d..a63191fd 100755
--- a/ale_linters/powershell/powershell.vim
+++ b/ale_linters/powershell/powershell.vim
@@ -49,11 +49,19 @@ function! ale_linters#powershell#powershell#Handle(buffer, lines) abort
let l:matchcount = 1
endif
- let l:item = {
- \ 'lnum': str2nr(l:match[1]),
- \ 'col': str2nr(l:match[2]),
- \ 'type': 'E',
- \}
+ " If the match is 0, it was a failed match
+ " probably due to an unexpected token which
+ " contained a newline. Reset matchcount. to
+ " continue to the next match
+ if !empty(l:match[1])
+ let l:item = {
+ \ 'lnum': str2nr(l:match[1]),
+ \ 'col': str2nr(l:match[2]),
+ \ 'type': 'E',
+ \}
+ else
+ let l:matchcount = 0
+ endif
elseif l:matchcount == 2
" Second match[0] grabs the full line in order
" to handles the text
@@ -84,8 +92,8 @@ endfunction
call ale#linter#Define('powershell', {
\ 'name': 'powershell',
-\ 'executable_callback': 'ale_linters#powershell#powershell#GetExecutable',
-\ 'command_callback': 'ale_linters#powershell#powershell#GetCommand',
+\ 'executable': function('ale_linters#powershell#powershell#GetExecutable'),
+\ 'command': function('ale_linters#powershell#powershell#GetCommand'),
\ 'output_stream': 'stdout',
\ 'callback': 'ale_linters#powershell#powershell#Handle',
\})