Merge branch 'master' into gcc_refactor
This commit is contained in:
commit
1541e3092e
@ -29,6 +29,7 @@ function syntastic#postprocess#compressWhitespace(errors)
|
||||
let llist = []
|
||||
|
||||
for e in a:errors
|
||||
let e['text'] = substitute(e['text'], "\001", '', 'g')
|
||||
let e['text'] = substitute(e['text'], '\n', ' ', 'g')
|
||||
let e['text'] = substitute(e['text'], '\s\{2,}', ' ', 'g')
|
||||
call add(llist, e)
|
||||
|
@ -64,6 +64,12 @@ if !exists("g:syntastic_full_redraws")
|
||||
let g:syntastic_full_redraws = !( has('gui_running') || has('gui_macvim'))
|
||||
endif
|
||||
|
||||
" TODO: not documented
|
||||
if !exists("g:syntastic_reuse_loc_lists")
|
||||
" a relevant bug has been fixed in one of the pre-releases of Vim 7.4
|
||||
let g:syntastic_reuse_loc_lists = (v:version >= 704)
|
||||
endif
|
||||
|
||||
let s:registry = g:SyntasticRegistry.Instance()
|
||||
let s:notifiers = g:SyntasticNotifiers.Instance()
|
||||
let s:modemap = g:SyntasticModeMap.Instance()
|
||||
@ -145,8 +151,10 @@ function! s:UpdateErrors(auto_invoked, ...)
|
||||
|
||||
let loclist = g:SyntasticLoclist.current()
|
||||
|
||||
let w:syntastic_loclist_set = 0
|
||||
if g:syntastic_always_populate_loc_list || g:syntastic_auto_jump
|
||||
call setloclist(0, loclist.filteredRaw())
|
||||
let w:syntastic_loclist_set = 1
|
||||
if run_checks && g:syntastic_auto_jump && loclist.hasErrorsOrWarningsToDisplay()
|
||||
silent! lrewind
|
||||
endif
|
||||
@ -356,7 +364,6 @@ endfunction
|
||||
function! SyntasticMake(options)
|
||||
call syntastic#util#debug('SyntasticMake: called with options: '. string(a:options))
|
||||
|
||||
let old_loclist = getloclist(0)
|
||||
let old_shell = &shell
|
||||
let old_shellredir = &shellredir
|
||||
let old_errorformat = &errorformat
|
||||
@ -390,13 +397,13 @@ function! SyntasticMake(options)
|
||||
endif
|
||||
lgetexpr err_lines
|
||||
|
||||
let errors = getloclist(0)
|
||||
let errors = copy(getloclist(0))
|
||||
|
||||
if has_key(a:options, 'cwd')
|
||||
exec 'lcd ' . fnameescape(old_cwd)
|
||||
endif
|
||||
|
||||
call setloclist(0, old_loclist)
|
||||
silent! lolder
|
||||
let &errorformat = old_errorformat
|
||||
let &shellredir = old_shellredir
|
||||
let &shell=old_shell
|
||||
|
@ -143,7 +143,12 @@ endfunction
|
||||
|
||||
"display the cached errors for this buf in the location list
|
||||
function! g:SyntasticLoclist.show()
|
||||
call setloclist(0, self.filteredRaw())
|
||||
if !exists('w:syntastic_loclist_set')
|
||||
let w:syntastic_loclist_set = 0
|
||||
endif
|
||||
call setloclist(0, self.filteredRaw(), g:syntastic_reuse_loc_lists && w:syntastic_loclist_set ? 'r' : ' ')
|
||||
let w:syntastic_loclist_set = 1
|
||||
|
||||
if self.hasErrorsOrWarningsToDisplay()
|
||||
let num = winnr()
|
||||
exec "lopen " . g:syntastic_loc_list_height
|
||||
|
@ -26,9 +26,9 @@ function! SyntaxCheckers_coffee_coffeelint_GetLocList()
|
||||
\ 'subchecker': 'coffeelint' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f\,%l\,%\d%\+\,%trror\,%m,' .
|
||||
\ '%f\,%l\,%\d%#\,%trror\,%m,' .
|
||||
\ '%f\,%l\,%trror\,%m,' .
|
||||
\ '%f\,%l\,%\d%\+\,%tarn\,%m,' .
|
||||
\ '%f\,%l\,%\d%#\,%tarn\,%m,' .
|
||||
\ '%f\,%l\,%tarn\,%m'
|
||||
|
||||
return SyntasticMake({
|
||||
|
@ -10,16 +10,21 @@
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_haskell_ghc_mod_checker")
|
||||
if exists('g:loaded_syntastic_haskell_ghc_mod_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_ghc_mod_checker=1
|
||||
let g:loaded_syntastic_haskell_ghc_mod_checker = 1
|
||||
|
||||
function! SyntaxCheckers_haskell_ghc_mod_IsAvailable()
|
||||
return executable('ghc-mod')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haskell_ghc_mod_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'ghc-mod check',
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'subchecker': 'ghc_mod' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-G%\s%#,' .
|
||||
\ '%f:%l:%c:%trror: %m,' .
|
||||
@ -30,16 +35,10 @@ function! SyntaxCheckers_haskell_ghc_mod_GetLocList()
|
||||
\ '%E%f:%l:%c:,' .
|
||||
\ '%Z%m'
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'ghc-mod check',
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'subchecker': 'ghc_mod' })
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
return loclist
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['compressWhitespace'] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -5,32 +5,30 @@
|
||||
"License: BSD
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_haskell_hlint_checker")
|
||||
if exists('g:loaded_syntastic_haskell_hlint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_hlint_checker=1
|
||||
let g:loaded_syntastic_haskell_hlint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_haskell_hlint_IsAvailable()
|
||||
return executable('hlint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haskell_hlint_GetLocList()
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: Error: %m,' .
|
||||
\ '%W%f:%l:%c: Warning: %m,' .
|
||||
\ '%C%m'
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'hlint',
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'subchecker': 'hlint' })
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: Error: %m,' .
|
||||
\ '%W%f:%l:%c: Warning: %m,' .
|
||||
\ '%C%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['compressWhitespace'] })
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
Loading…
Reference in New Issue
Block a user