Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
place different signs for warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Grenfell committed Jul 14, 2009
1 parent 378f742 commit 7fc70a7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plugin/syntastic.vim
Expand Up @@ -163,19 +163,25 @@ endfunction


"use >> to display syntax errors in the sign column
sign define SyntaxError text=>> texthl=error
sign define SyntasticError text=>> texthl=error
sign define SyntasticWarning text=>> texthl=warningmsg

"start counting sign ids at 5000, start here to hopefully avoid conflicting
"with any other code that places signs (not sure if this precaution is
"actually needed)
let s:first_sign_id = 5000
let s:next_sign_id = s:first_sign_id

"place SyntaxError signs by all syntax errs in the buffer
"place signs by all syntax errs in the buffer
function s:SignErrors()
if s:BufHasErrors()
for i in b:syntastic_loclist
exec "sign place ". s:next_sign_id ." line=". i['lnum'] ." name=SyntaxError file=". expand("%:p")
let sign_type = 'SyntasticError'
if i['type'] == 'W'
let sign_type = 'SyntasticWarning'
endif

exec "sign place ". s:next_sign_id ." line=". i['lnum'] ." name=". sign_type ." file=". expand("%:p")
call add(s:BufSignIds(), s:next_sign_id)
let s:next_sign_id += 1
endfor
Expand Down

0 comments on commit 7fc70a7

Please sign in to comment.