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