diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-19 01:08:20 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-19 01:08:20 +0000 |
commit | 01b2971d0432d6d25af0c592b4e0b2fdc7adcf7d (patch) | |
tree | 30a140041081c759bdf4e7219dba2516adb6b483 /ale_linters/slim/slimlint.vim | |
parent | 7123f7236b5415c29f1b48c01d2528f71c457be2 (diff) | |
download | ale-01b2971d0432d6d25af0c592b4e0b2fdc7adcf7d.zip |
#852 - Capture error codes for slim-lint
Diffstat (limited to 'ale_linters/slim/slimlint.vim')
-rw-r--r-- | ale_linters/slim/slimlint.vim | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ale_linters/slim/slimlint.vim b/ale_linters/slim/slimlint.vim index bb62c731..00c6b26c 100644 --- a/ale_linters/slim/slimlint.vim +++ b/ale_linters/slim/slimlint.vim @@ -28,11 +28,20 @@ function! ale_linters#slim#slimlint#Handle(buffer, lines) abort let l:output = [] for l:match in ale#util#GetMatches(a:lines, l:pattern) - call add(l:output, { + let l:item = { \ 'lnum': l:match[1] + 0, \ 'type': l:match[2], \ 'text': l:match[3] - \}) + \} + + let l:code_match = matchlist(l:item.text, '\v^([^:]+): (.+)$') + + if !empty(l:code_match) + let l:item.code = l:code_match[1] + let l:item.text = l:code_match[2] + endif + + call add(l:output, l:item) endfor return l:output |