99" See http://sam.zoy.org/wtfpl/COPYING for more details.
1010"
1111" ============================================================================
12- "
13- " " To use a lint option file, rename it to options.lnt and put it in
14- " " the same directory as the file you're linting, or any parent directory
15- " " of that file. Syntastic will use the first options.lnt file it finds.
1612
1713if exists (" g:loaded_syntastic_c_pc_lint_checker" )
1814 finish
@@ -26,40 +22,30 @@ if !exists('g:syntastic_pc_lint_config_file')
2622 let g: syntastic_pc_lint_config_file = ' options.lnt'
2723endif
2824
29- " stolen from c.vim in syntastic
30- function ! s: getOptionFile (file )
31- " search in the current file's directory upwards
32- let config = findfile (a: file , ' .;' )
33- if config == ' ' || ! filereadable (config)
34- return ' '
35- endif
36- " convert filename into absolute path filename
37- return fnamemodify (config, ' :p' )
38- endfunction
39-
4025function ! SyntaxCheckers_c_pc_lint_GetLocList () dict
26+ let config = findfile (g: syntastic_pc_lint_config_file , ' .;' )
4127
42- " -hF1 always shows the filename, tries to make message 1 line
43- " -width(0,0) makes sure there's no line breaks
28+ " -hF1 - show filename, try to make message 1 line
29+ " -width(0,0) - make sure there are no line breaks
4430 let makeprg = self .makeprgBuild ({
45- \ " args" : syntastic#util#shescape (
46- \ s: getOptionFile (g: syntastic_pc_lint_config_file )) . ' -hF1 ' .
47- \ syntastic#util#shescape (' -width(0,0)' )})
31+ \ ' args' : (filereadable (config) ? syntastic#util#shescape (fnamemodify (config, ' :p' )) : ' ' ),
32+ \ ' args_after' : [' -hF1' , ' -width(0,0)' ] })
4833
4934 let errorformat =
50- \ ' %f %l %trror %n: %m,' .
51- \ ' %f %l %tarning %n: %m,' .
52- \ ' %W%f %l Info %n: %m'
35+ \ ' %E%f %l Error %n: %m,' .
36+ \ ' %W%f %l Warning %n: %m,' .
37+ \ ' %W%f %l Info %n: %m,' .
38+ \ ' %-G%.%#'
5339
5440 return SyntasticMake ({
55- \ ' makeprg' : makeprg ,
56- \ ' errorformat' : errorformat })
41+ \ ' makeprg' : makeprg ,
42+ \ ' errorformat' : errorformat })
5743endfunction
5844
5945call g: SyntasticRegistry .CreateAndRegisterChecker ({
60- \ ' filetype' : ' c' ,
61- \ ' name' : ' pc_lint' ,
62- \ ' exec' : ' lint-nt' })
46+ \ ' filetype' : ' c' ,
47+ \ ' name' : ' pc_lint' ,
48+ \ ' exec' : ' lint-nt' })
6349
6450let &cpo = s: save_cpo
6551unlet s: save_cpo
0 commit comments