syntastic python: highlight identificators with errors
This commit is contained in:
parent
172a64916d
commit
8c5bf3afbd
@ -4,7 +4,7 @@ endif
|
|||||||
let loaded_python_syntax_checker = 1
|
let loaded_python_syntax_checker = 1
|
||||||
|
|
||||||
"bail if the user doesnt have pyflakes installed
|
"bail if the user doesnt have pyflakes installed
|
||||||
if !executable("pyflakes")
|
if !executable("pyflakes") || !executable("grep")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -14,10 +14,18 @@ function! SyntaxCheckers_python_GetLocList()
|
|||||||
|
|
||||||
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||||
|
|
||||||
|
call clearmatches()
|
||||||
for i in errors
|
for i in errors
|
||||||
if i['type'] ==# 'E'
|
if i['type'] ==# 'E'
|
||||||
let i['text'] = "Syntax error"
|
let i['text'] = "Syntax error"
|
||||||
endif
|
endif
|
||||||
|
if match(i['text'], 'is assigned to but never used') > -1
|
||||||
|
\ || match(i['text'], 'imported but unused') > -1
|
||||||
|
\ || match(i['text'], 'undefined name') > -1
|
||||||
|
\ || match(i['text'], 'redefinition of unused') > -1
|
||||||
|
let term = split(i['text'], "'", 1)[1]
|
||||||
|
call matchadd('SpellBad', '\%' . i['lnum'] . 'l\<' . term . '\>')
|
||||||
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user