Source uglification, part II.

The names from commit 4e9e08b conflict with &viminfo containing "!".
This commit is contained in:
LCD 47 2014-10-17 18:53:53 +03:00
parent 4e9e08b509
commit 948202d042
13 changed files with 102 additions and 102 deletions

View File

@ -120,7 +120,7 @@ function! syntastic#log#debugDump(level) " {{{2
return return
endif endif
call syntastic#log#debugShowVariables( a:level, sort(keys(g:SYNTASTIC_DEFAULTS)) ) call syntastic#log#debugShowVariables( a:level, sort(keys(g:_SYNTASTIC_DEFAULTS)) )
endfunction " }}}2 endfunction " }}}2
" }}}1 " }}}1
@ -155,7 +155,7 @@ function! s:_logRedirect(on) " {{{2
endfunction " }}}2 endfunction " }}}2
function! s:_logTimestamp() " {{{2 function! s:_logTimestamp() " {{{2
return 'syntastic: ' . split(reltimestr(reltime(g:SYNTASTIC_START)))[0] . ': ' return 'syntastic: ' . split(reltimestr(reltime(g:_SYNTASTIC_START)))[0] . ': '
endfunction " }}}2 endfunction " }}}2
function! s:_formatVariable(name) " {{{2 function! s:_formatVariable(name) " {{{2

View File

@ -274,7 +274,7 @@ endfunction " }}}2
function! syntastic#util#dictFilter(errors, filter) " {{{2 function! syntastic#util#dictFilter(errors, filter) " {{{2
let rules = s:_translateFilter(a:filter) let rules = s:_translateFilter(a:filter)
" call syntastic#log#debug(g:SYNTASTIC_DEBUG_TRACE, "applying filter:", rules) " call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, "applying filter:", rules)
try try
call filter(a:errors, rules) call filter(a:errors, rules)
catch /\m^Vim\%((\a\+)\)\=:E/ catch /\m^Vim\%((\a\+)\)\=:E/
@ -287,7 +287,7 @@ endfunction " }}}2
" (hopefully high resolution) since program start " (hopefully high resolution) since program start
" TODO: This assumes reltime() returns a list of integers. " TODO: This assumes reltime() returns a list of integers.
function! syntastic#util#stamp() " {{{2 function! syntastic#util#stamp() " {{{2
return reltime(g:SYNTASTIC_START) return reltime(g:_SYNTASTIC_START)
endfunction " }}}2 endfunction " }}}2
" }}}1 " }}}1

View File

@ -15,12 +15,12 @@ endif
let g:loaded_syntastic_plugin = 1 let g:loaded_syntastic_plugin = 1
if has('reltime') if has('reltime')
let g:SYNTASTIC_START = reltime() let g:_SYNTASTIC_START = reltime()
lockvar! g:SYNTASTIC_START lockvar! g:_SYNTASTIC_START
endif endif
let g:SYNTASTIC_VERSION = '3.5.0-72' let g:_SYNTASTIC_VERSION = '3.5.0-72'
lockvar g:SYNTASTIC_VERSION lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1 " Sanity checks {{{1
@ -39,24 +39,24 @@ for s:feature in [
endif endif
endfor endfor
let s:running_windows = syntastic#util#isRunningWindows() let s:_running_windows = syntastic#util#isRunningWindows()
lockvar s:running_windows lockvar s:_running_windows
if !s:running_windows && executable('uname') if !s:_running_windows && executable('uname')
try try
let s:uname = system('uname') let s:_uname = system('uname')
catch /\m^Vim\%((\a\+)\)\=:E484/ catch /\m^Vim\%((\a\+)\)\=:E484/
call syntastic#log#error("your shell " . &shell . " can't handle traditional UNIX syntax for redirections") call syntastic#log#error("your shell " . &shell . " can't handle traditional UNIX syntax for redirections")
finish finish
endtry endtry
lockvar s:uname lockvar s:_uname
endif endif
" }}}1 " }}}1
" Defaults {{{1 " Defaults {{{1
let g:SYNTASTIC_DEFAULTS = { let g:_SYNTASTIC_DEFAULTS = {
\ 'aggregate_errors': 0, \ 'aggregate_errors': 0,
\ 'always_populate_loc_list': 0, \ 'always_populate_loc_list': 0,
\ 'auto_jump': 0, \ 'auto_jump': 0,
@ -71,7 +71,7 @@ let g:SYNTASTIC_DEFAULTS = {
\ 'enable_highlighting': 1, \ 'enable_highlighting': 1,
\ 'enable_signs': 1, \ 'enable_signs': 1,
\ 'error_symbol': '>>', \ 'error_symbol': '>>',
\ 'exit_checks': !(s:running_windows && &shell =~? '\m\<cmd\.exe$'), \ 'exit_checks': !(s:_running_windows && &shell =~? '\m\<cmd\.exe$'),
\ 'filetype_map': {}, \ 'filetype_map': {},
\ 'full_redraws': !(has('gui_running') || has('gui_macvim')), \ 'full_redraws': !(has('gui_running') || has('gui_macvim')),
\ 'id_checkers': 1, \ 'id_checkers': 1,
@ -86,11 +86,11 @@ let g:SYNTASTIC_DEFAULTS = {
\ 'style_warning_symbol': 'S>', \ 'style_warning_symbol': 'S>',
\ 'warning_symbol': '>>' \ 'warning_symbol': '>>'
\ } \ }
lockvar! g:SYNTASTIC_DEFAULTS lockvar! g:_SYNTASTIC_DEFAULTS
for s:key in keys(g:SYNTASTIC_DEFAULTS) for s:key in keys(g:_SYNTASTIC_DEFAULTS)
if !exists('g:syntastic_' . s:key) if !exists('g:syntastic_' . s:key)
let g:syntastic_{s:key} = copy(g:SYNTASTIC_DEFAULTS[s:key]) let g:syntastic_{s:key} = copy(g:_SYNTASTIC_DEFAULTS[s:key])
endif endif
endfor endfor
@ -110,7 +110,7 @@ endif
" Debug {{{1 " Debug {{{1
let s:DEBUG_DUMP_OPTIONS = [ let s:_DEBUG_DUMP_OPTIONS = [
\ 'shell', \ 'shell',
\ 'shellcmdflag', \ 'shellcmdflag',
\ 'shellpipe', \ 'shellpipe',
@ -121,23 +121,23 @@ let s:DEBUG_DUMP_OPTIONS = [
\ 'shellxquote' \ 'shellxquote'
\ ] \ ]
if v:version > 703 || (v:version == 703 && has('patch446')) if v:version > 703 || (v:version == 703 && has('patch446'))
call add(s:DEBUG_DUMP_OPTIONS, 'shellxescape') call add(s:_DEBUG_DUMP_OPTIONS, 'shellxescape')
endif endif
lockvar! s:DEBUG_DUMP_OPTIONS lockvar! s:_DEBUG_DUMP_OPTIONS
" debug constants " debug constants
let g:SYNTASTIC_DEBUG_TRACE = 1 let g:_SYNTASTIC_DEBUG_TRACE = 1
lockvar g:SYNTASTIC_DEBUG_TRACE lockvar g:_SYNTASTIC_DEBUG_TRACE
let g:SYNTASTIC_DEBUG_LOCLIST = 2 let g:_SYNTASTIC_DEBUG_LOCLIST = 2
lockvar g:SYNTASTIC_DEBUG_LOCLIST lockvar g:_SYNTASTIC_DEBUG_LOCLIST
let g:SYNTASTIC_DEBUG_NOTIFICATIONS = 4 let g:_SYNTASTIC_DEBUG_NOTIFICATIONS = 4
lockvar g:SYNTASTIC_DEBUG_NOTIFICATIONS lockvar g:_SYNTASTIC_DEBUG_NOTIFICATIONS
let g:SYNTASTIC_DEBUG_AUTOCOMMANDS = 8 let g:_SYNTASTIC_DEBUG_AUTOCOMMANDS = 8
lockvar g:SYNTASTIC_DEBUG_AUTOCOMMANDS lockvar g:_SYNTASTIC_DEBUG_AUTOCOMMANDS
let g:SYNTASTIC_DEBUG_VARIABLES = 16 let g:_SYNTASTIC_DEBUG_VARIABLES = 16
lockvar g:SYNTASTIC_DEBUG_VARIABLES lockvar g:_SYNTASTIC_DEBUG_VARIABLES
let g:SYNTASTIC_DEBUG_CHECKERS = 32 let g:_SYNTASTIC_DEBUG_CHECKERS = 32
lockvar g:SYNTASTIC_DEBUG_CHECKERS lockvar g:_SYNTASTIC_DEBUG_CHECKERS
" }}}1 " }}}1
@ -207,20 +207,20 @@ endif
function! s:BufReadPostHook() " {{{2 function! s:BufReadPostHook() " {{{2
if g:syntastic_check_on_open if g:syntastic_check_on_open
call syntastic#log#debug(g:SYNTASTIC_DEBUG_AUTOCOMMANDS, call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
\ 'autocmd: BufReadPost, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr(""))))) \ 'autocmd: BufReadPost, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
call s:UpdateErrors(1) call s:UpdateErrors(1)
endif endif
endfunction " }}}2 endfunction " }}}2
function! s:BufWritePostHook() " {{{2 function! s:BufWritePostHook() " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_AUTOCOMMANDS, call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
\ 'autocmd: BufWritePost, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr(""))))) \ 'autocmd: BufWritePost, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
call s:UpdateErrors(1) call s:UpdateErrors(1)
endfunction " }}}2 endfunction " }}}2
function! s:BufEnterHook() " {{{2 function! s:BufEnterHook() " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_AUTOCOMMANDS, call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
\ 'autocmd: BufEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) . \ 'autocmd: BufEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
\ ', &buftype = ' . string(&buftype)) \ ', &buftype = ' . string(&buftype))
if &buftype == '' if &buftype == ''
@ -239,7 +239,7 @@ function! s:BufEnterHook() " {{{2
endfunction " }}}2 endfunction " }}}2
function! s:QuitPreHook() " {{{2 function! s:QuitPreHook() " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_AUTOCOMMANDS, call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
\ 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr(""))))) \ 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
let b:syntastic_skip_checks = get(b:, 'syntastic_skip_checks', 0) || !syntastic#util#var('check_on_wq') let b:syntastic_skip_checks = get(b:, 'syntastic_skip_checks', 0) || !syntastic#util#var('check_on_wq')
call SyntasticLoclistHide() call SyntasticLoclistHide()
@ -251,10 +251,10 @@ endfunction " }}}2
"refresh and redraw all the error info for this buf when saving or reading "refresh and redraw all the error info for this buf when saving or reading
function! s:UpdateErrors(auto_invoked, ...) " {{{2 function! s:UpdateErrors(auto_invoked, ...) " {{{2
call syntastic#log#debugShowVariables(g:SYNTASTIC_DEBUG_TRACE, 'version') call syntastic#log#debugShowVariables(g:_SYNTASTIC_DEBUG_TRACE, 'version')
call syntastic#log#debugShowOptions(g:SYNTASTIC_DEBUG_TRACE, s:DEBUG_DUMP_OPTIONS) call syntastic#log#debugShowOptions(g:_SYNTASTIC_DEBUG_TRACE, s:_DEBUG_DUMP_OPTIONS)
call syntastic#log#debugDump(g:SYNTASTIC_DEBUG_VARIABLES) call syntastic#log#debugDump(g:_SYNTASTIC_DEBUG_VARIABLES)
call syntastic#log#debug(g:SYNTASTIC_DEBUG_TRACE, 'UpdateErrors' . (a:auto_invoked ? ' (auto)' : '') . call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'UpdateErrors' . (a:auto_invoked ? ' (auto)' : '') .
\ ': ' . (a:0 ? join(a:000) : 'default checkers')) \ ': ' . (a:0 ? join(a:000) : 'default checkers'))
if s:skipFile() if s:skipFile()
return return
@ -278,11 +278,11 @@ function! s:UpdateErrors(auto_invoked, ...) " {{{2
let w:syntastic_loclist_set = 0 let w:syntastic_loclist_set = 0
if syntastic#util#var('always_populate_loc_list') || do_jump if syntastic#util#var('always_populate_loc_list') || do_jump
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist (new)') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist (new)')
call setloclist(0, loclist.getRaw()) call setloclist(0, loclist.getRaw())
let w:syntastic_loclist_set = 1 let w:syntastic_loclist_set = 1
if run_checks && do_jump && !loclist.isEmpty() if run_checks && do_jump && !loclist.isEmpty()
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: jump') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: jump')
silent! lrewind silent! lrewind
" XXX: Vim doesn't call autocmd commands in a predictible " XXX: Vim doesn't call autocmd commands in a predictible
@ -307,15 +307,15 @@ endfunction " }}}2
"detect and cache all syntax errors in this buffer "detect and cache all syntax errors in this buffer
function! s:CacheErrors(checker_names) " {{{2 function! s:CacheErrors(checker_names) " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_TRACE, 'CacheErrors: ' . call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: ' .
\ (len(a:checker_names) ? join(a:checker_names) : 'default checkers')) \ (len(a:checker_names) ? join(a:checker_names) : 'default checkers'))
call s:ClearCache() call s:ClearCache()
let newLoclist = g:SyntasticLoclist.New([]) let newLoclist = g:SyntasticLoclist.New([])
if !s:skipFile() if !s:skipFile()
" debug logging {{{3 " debug logging {{{3
call syntastic#log#debugShowVariables(g:SYNTASTIC_DEBUG_TRACE, 'aggregate_errors') call syntastic#log#debugShowVariables(g:_SYNTASTIC_DEBUG_TRACE, 'aggregate_errors')
call syntastic#log#debug(g:SYNTASTIC_DEBUG_TRACE, 'getcwd() = ' . getcwd()) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getcwd() = ' . getcwd())
" }}}3 " }}}3
let filetypes = s:resolveFiletypes() let filetypes = s:resolveFiletypes()
@ -333,12 +333,12 @@ function! s:CacheErrors(checker_names) " {{{2
for checker in clist for checker in clist
let cname = checker.getFiletype() . '/' . checker.getName() let cname = checker.getFiletype() . '/' . checker.getName()
if !checker.isAvailable() if !checker.isAvailable()
call syntastic#log#debug(g:SYNTASTIC_DEBUG_TRACE, 'CacheErrors: Checker ' . cname . ' is not available') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: Checker ' . cname . ' is not available')
let unavailable_checkers += 1 let unavailable_checkers += 1
continue continue
endif endif
call syntastic#log#debug(g:SYNTASTIC_DEBUG_TRACE, 'CacheErrors: Invoking checker: ' . cname) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: Invoking checker: ' . cname)
let loclist = checker.getLocList() let loclist = checker.getLocList()
@ -349,7 +349,7 @@ function! s:CacheErrors(checker_names) " {{{2
call add(names, cname) call add(names, cname)
if checker.getWantSort() && !sort_aggregated_errors if checker.getWantSort() && !sort_aggregated_errors
call loclist.sort() call loclist.sort()
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'sorted:', loclist) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'sorted:', loclist)
endif endif
let newLoclist = newLoclist.extend(loclist) let newLoclist = newLoclist.extend(loclist)
@ -382,15 +382,15 @@ function! s:CacheErrors(checker_names) " {{{2
call syntastic#log#warn('checkers ' . join(a:checker_names, ', ') . ' are not available') call syntastic#log#warn('checkers ' . join(a:checker_names, ', ') . ' are not available')
endif endif
else else
call syntastic#log#debug(g:SYNTASTIC_DEBUG_TRACE, 'CacheErrors: no checkers available for ' . &filetype) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: no checkers available for ' . &filetype)
endif endif
endif endif
" }}}3 " }}}3
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'aggregated:', newLoclist) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'aggregated:', newLoclist)
if sort_aggregated_errors if sort_aggregated_errors
call newLoclist.sort() call newLoclist.sort()
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'sorted:', newLoclist) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'sorted:', newLoclist)
endif endif
endif endif
@ -429,7 +429,7 @@ endfunction " }}}2
" 'returns' - a list of valid exit codes for the checker " 'returns' - a list of valid exit codes for the checker
" @vimlint(EVL102, 1, l:env_save) " @vimlint(EVL102, 1, l:env_save)
function! SyntasticMake(options) " {{{2 function! SyntasticMake(options) " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_TRACE, 'SyntasticMake: called with options:', a:options) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'SyntasticMake: called with options:', a:options)
" save options and locale env variables {{{3 " save options and locale env variables {{{3
let old_shellredir = &shellredir let old_shellredir = &shellredir
@ -476,14 +476,14 @@ function! SyntasticMake(options) " {{{2
endif endif
" }}}3 " }}}3
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'checker output:', err_lines) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', err_lines)
if has_key(a:options, 'Preprocess') if has_key(a:options, 'Preprocess')
let err_lines = call(a:options['Preprocess'], [err_lines]) let err_lines = call(a:options['Preprocess'], [err_lines])
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'preprocess (external):', err_lines) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'preprocess (external):', err_lines)
elseif has_key(a:options, 'preprocess') elseif has_key(a:options, 'preprocess')
let err_lines = call('syntastic#preprocess#' . a:options['preprocess'], [err_lines]) let err_lines = call('syntastic#preprocess#' . a:options['preprocess'], [err_lines])
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'preprocess:', err_lines) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'preprocess:', err_lines)
endif endif
lgetexpr err_lines lgetexpr err_lines
@ -509,11 +509,11 @@ function! SyntasticMake(options) " {{{2
let &shellredir = old_shellredir let &shellredir = old_shellredir
" }}}3 " }}}3
if !s:running_windows && (s:uname() =~ "FreeBSD" || s:uname() =~ "OpenBSD") if !s:_running_windows && (s:uname() =~ "FreeBSD" || s:uname() =~ "OpenBSD")
call syntastic#util#redraw(g:syntastic_full_redraws) call syntastic#util#redraw(g:syntastic_full_redraws)
endif endif
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'raw loclist:', errors) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'raw loclist:', errors)
if syntastic#util#var('exit_checks') && has_key(a:options, 'returns') && index(a:options['returns'], v:shell_error) == -1 if syntastic#util#var('exit_checks') && has_key(a:options, 'returns') && index(a:options['returns'], v:shell_error) == -1
throw 'Syntastic: checker error' throw 'Syntastic: checker error'
@ -532,12 +532,12 @@ function! SyntasticMake(options) " {{{2
for rule in a:options['Postprocess'] for rule in a:options['Postprocess']
let errors = call(rule, [errors]) let errors = call(rule, [errors])
endfor endfor
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'postprocess (external):', errors) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'postprocess (external):', errors)
elseif has_key(a:options, 'postprocess') && !empty(a:options['postprocess']) elseif has_key(a:options, 'postprocess') && !empty(a:options['postprocess'])
for rule in a:options['postprocess'] for rule in a:options['postprocess']
let errors = call('syntastic#postprocess#' . rule, [errors]) let errors = call('syntastic#postprocess#' . rule, [errors])
endfor endfor
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'postprocess:', errors) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'postprocess:', errors)
endif endif
return errors return errors
@ -578,7 +578,7 @@ function! s:skipFile() " {{{2
\ !filereadable(fname) || getwinvar(0, '&diff') || s:ignoreFile(fname) || \ !filereadable(fname) || getwinvar(0, '&diff') || s:ignoreFile(fname) ||
\ fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions \ fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions
if skip if skip
call syntastic#log#debug(g:SYNTASTIC_DEBUG_TRACE, 'skipFile: skipping') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'skipFile: skipping')
endif endif
return skip return skip
endfunction " }}}2 endfunction " }}}2
@ -632,7 +632,7 @@ function! s:bashHack() " {{{2
if g:syntastic_bash_hack if g:syntastic_bash_hack
if !exists('s:shell_is_bash') if !exists('s:shell_is_bash')
let s:shell_is_bash = let s:shell_is_bash =
\ !s:running_windows && \ !s:_running_windows &&
\ (s:uname() !~# "FreeBSD") && (s:uname() !~# "OpenBSD") && \ (s:uname() !~# "FreeBSD") && (s:uname() !~# "OpenBSD") &&
\ &shell =~# '\m\<bash$' \ &shell =~# '\m\<bash$'
endif endif
@ -644,11 +644,11 @@ function! s:bashHack() " {{{2
endfunction " }}}2 endfunction " }}}2
function! s:uname() " {{{2 function! s:uname() " {{{2
if !exists('s:uname') if !exists('s:_uname')
let s:uname = system('uname') let s:_uname = system('uname')
lockvar s:uname lockvar s:_uname
endif endif
return s:uname return s:_uname
endfunction " }}}2 endfunction " }}}2
" }}}1 " }}}1

View File

@ -13,12 +13,12 @@ function! g:SyntasticAutoloclistNotifier.New() " {{{2
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticAutoloclistNotifier.refresh(loclist) " {{{2 function! g:SyntasticAutoloclistNotifier.refresh(loclist) " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'autoloclist: refresh') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'autoloclist: refresh')
call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist) call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist)
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) " {{{2 function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'autoloclist: toggle') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'autoloclist: toggle')
if !a:loclist.isEmpty() if !a:loclist.isEmpty()
if syntastic#util#var('auto_loc_list') == 1 if syntastic#util#var('auto_loc_list') == 1
call a:loclist.show() call a:loclist.show()

View File

@ -36,7 +36,7 @@ endfunction " }}}2
function! g:SyntasticBalloonsNotifier.reset(loclist) " {{{2 function! g:SyntasticBalloonsNotifier.reset(loclist) " {{{2
let b:syntastic_balloons = {} let b:syntastic_balloons = {}
if has('balloon_eval') if has('balloon_eval')
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'balloons: reset') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'balloons: reset')
unlet! b:syntastic_balloons unlet! b:syntastic_balloons
set noballooneval set noballooneval
endif endif

View File

@ -59,13 +59,13 @@ function! g:SyntasticChecker.getLocListRaw() " {{{2
let name = self._filetype . '/' . self._name let name = self._filetype . '/' . self._name
try try
let list = self._locListFunc() let list = self._locListFunc()
call syntastic#log#debug(g:SYNTASTIC_DEBUG_TRACE, 'getLocList: checker ' . name . ' returned ' . v:shell_error) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getLocList: checker ' . name . ' returned ' . v:shell_error)
catch /\m\C^Syntastic: checker error$/ catch /\m\C^Syntastic: checker error$/
let list = [] let list = []
call syntastic#log#error('checker ' . name . ' returned abnormal status ' . v:shell_error) call syntastic#log#error('checker ' . name . ' returned abnormal status ' . v:shell_error)
endtry endtry
call self._populateHighlightRegexes(list) call self._populateHighlightRegexes(list)
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, name . ' raw:', list) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, name . ' raw:', list)
call self._quietMessages(list) call self._quietMessages(list)
return list return list
endfunction " }}}2 endfunction " }}}2
@ -85,9 +85,9 @@ endfunction " }}}2
function! g:SyntasticChecker.log(msg, ...) " {{{2 function! g:SyntasticChecker.log(msg, ...) " {{{2
let leader = self._filetype . '/' . self._name . ': ' let leader = self._filetype . '/' . self._name . ': '
if a:0 > 0 if a:0 > 0
call syntastic#log#debug(g:SYNTASTIC_DEBUG_CHECKERS, leader . a:msg, a:1) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, leader . a:msg, a:1)
else else
call syntastic#log#debug(g:SYNTASTIC_DEBUG_CHECKERS, leader . a:msg) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, leader . a:msg)
endif endif
endfunction " }}}2 endfunction " }}}2
@ -132,11 +132,11 @@ function! g:SyntasticChecker._quietMessages(errors) " {{{2
call syntastic#log#warn('ignoring invalid syntastic_' . name . '_quiet_messages') call syntastic#log#warn('ignoring invalid syntastic_' . name . '_quiet_messages')
endtry endtry
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'quiet_messages filter:', quiet_filters) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'quiet_messages filter:', quiet_filters)
if !empty(quiet_filters) if !empty(quiet_filters)
call syntastic#util#dictFilter(a:errors, quiet_filters) call syntastic#util#dictFilter(a:errors, quiet_filters)
call syntastic#log#debug(g:SYNTASTIC_DEBUG_LOCLIST, 'filtered by quiet_messages:', a:errors) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'filtered by quiet_messages:', a:errors)
endif endif
endfunction " }}}2 endfunction " }}}2

View File

@ -18,7 +18,7 @@ endfunction " }}}2
function! g:SyntasticCursorNotifier.refresh(loclist) " {{{2 function! g:SyntasticCursorNotifier.refresh(loclist) " {{{2
if self.enabled() && !a:loclist.isEmpty() if self.enabled() && !a:loclist.isEmpty()
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'cursor: refresh') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'cursor: refresh')
let b:syntastic_messages = copy(a:loclist.messages(bufnr(''))) let b:syntastic_messages = copy(a:loclist.messages(bufnr('')))
let b:syntastic_line = -1 let b:syntastic_line = -1
let b:syntastic_cursor_columns = a:loclist.getCursorColumns() let b:syntastic_cursor_columns = a:loclist.getCursorColumns()
@ -29,7 +29,7 @@ endfunction " }}}2
" @vimlint(EVL103, 1, a:loclist) " @vimlint(EVL103, 1, a:loclist)
function! g:SyntasticCursorNotifier.reset(loclist) " {{{2 function! g:SyntasticCursorNotifier.reset(loclist) " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'cursor: reset') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'cursor: reset')
autocmd! syntastic CursorMoved autocmd! syntastic CursorMoved
unlet! b:syntastic_messages unlet! b:syntastic_messages
let b:syntastic_line = -1 let b:syntastic_line = -1

View File

@ -32,7 +32,7 @@ endfunction " }}}2
" Sets error highlights in the cuirrent window " Sets error highlights in the cuirrent window
function! g:SyntasticHighlightingNotifier.refresh(loclist) " {{{2 function! g:SyntasticHighlightingNotifier.refresh(loclist) " {{{2
if self.enabled() if self.enabled()
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'highlighting: refresh') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'highlighting: refresh')
call self._reset() call self._reset()
let buf = bufnr('') let buf = bufnr('')
let issues = filter(a:loclist.copyRaw(), 'v:val["bufnr"] == buf') let issues = filter(a:loclist.copyRaw(), 'v:val["bufnr"] == buf')
@ -63,7 +63,7 @@ endfunction " }}}2
" @vimlint(EVL103, 1, a:loclist) " @vimlint(EVL103, 1, a:loclist)
function! g:SyntasticHighlightingNotifier.reset(loclist) " {{{2 function! g:SyntasticHighlightingNotifier.reset(loclist) " {{{2
if s:has_highlighting if s:has_highlighting
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'highlighting: reset') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'highlighting: reset')
call self._reset() call self._reset()
endif endif
endfunction " }}}2 endfunction " }}}2

View File

@ -281,14 +281,14 @@ function! g:SyntasticLoclist.setloclist() " {{{2
let w:syntastic_loclist_set = 0 let w:syntastic_loclist_set = 0
endif endif
let replace = g:syntastic_reuse_loc_lists && w:syntastic_loclist_set let replace = g:syntastic_reuse_loc_lists && w:syntastic_loclist_set
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist ' . (replace ? '(replace)' : '(new)')) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist ' . (replace ? '(replace)' : '(new)'))
call setloclist(0, self.getRaw(), replace ? 'r' : ' ') call setloclist(0, self.getRaw(), replace ? 'r' : ' ')
let w:syntastic_loclist_set = 1 let w:syntastic_loclist_set = 1
endfunction " }}}2 endfunction " }}}2
"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() " {{{2 function! g:SyntasticLoclist.show() " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: show') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: show')
call self.setloclist() call self.setloclist()
if !self.isEmpty() if !self.isEmpty()
@ -323,7 +323,7 @@ endfunction " }}}2
" Non-method functions {{{1 " Non-method functions {{{1
function! SyntasticLoclistHide() " {{{2 function! SyntasticLoclistHide() " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: hide') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: hide')
silent! lclose silent! lclose
endfunction " }}}2 endfunction " }}}2

View File

@ -63,7 +63,7 @@ function! g:SyntasticModeMap.echoMode() " {{{2
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticModeMap.modeInfo(...) " {{{2 function! g:SyntasticModeMap.modeInfo(...) " {{{2
echomsg 'Syntastic version: ' . g:SYNTASTIC_VERSION echomsg 'Syntastic version: ' . g:_SYNTASTIC_VERSION
let type = a:0 ? a:1 : &filetype let type = a:0 ? a:1 : &filetype
echomsg 'Info for filetype: ' . type echomsg 'Info for filetype: ' . type

View File

@ -5,11 +5,11 @@ let g:loaded_syntastic_notifiers = 1
let g:SyntasticNotifiers = {} let g:SyntasticNotifiers = {}
let s:NOTIFIER_TYPES = ['signs', 'balloons', 'highlighting', 'cursor', 'autoloclist'] let s:_NOTIFIER_TYPES = ['signs', 'balloons', 'highlighting', 'cursor', 'autoloclist']
lockvar! s:NOTIFIER_TYPES lockvar! s:_NOTIFIER_TYPES
let s:PERSISTENT_NOTIFIERS = ['signs', 'balloons'] let s:_PERSISTENT_NOTIFIERS = ['signs', 'balloons']
lockvar! s:PERSISTENT_NOTIFIERS lockvar! s:_PERSISTENT_NOTIFIERS
" Public methods {{{1 " Public methods {{{1
@ -28,11 +28,11 @@ function! g:SyntasticNotifiers.refresh(loclist) " {{{2
return return
endif endif
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'notifiers: refresh') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'notifiers: refresh')
for type in self._enabled_types for type in self._enabled_types
let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '') let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
if !has_key(g:{class}, 'enabled') || self._notifier[type].enabled() if !has_key(g:{class}, 'enabled') || self._notifier[type].enabled()
if index(s:PERSISTENT_NOTIFIERS, type) > -1 if index(s:_PERSISTENT_NOTIFIERS, type) > -1
" refresh only if loclist has changed since last call " refresh only if loclist has changed since last call
if !exists('b:syntastic_' . type . '_stamp') if !exists('b:syntastic_' . type . '_stamp')
let b:syntastic_{type}_stamp = [] let b:syntastic_{type}_stamp = []
@ -49,7 +49,7 @@ function! g:SyntasticNotifiers.refresh(loclist) " {{{2
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticNotifiers.reset(loclist) " {{{2 function! g:SyntasticNotifiers.reset(loclist) " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'notifiers: reset') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'notifiers: reset')
for type in self._enabled_types for type in self._enabled_types
let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '') let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
@ -61,7 +61,7 @@ function! g:SyntasticNotifiers.reset(loclist) " {{{2
endif endif
" also reset stamps " also reset stamps
if index(s:PERSISTENT_NOTIFIERS, type) > -1 if index(s:_PERSISTENT_NOTIFIERS, type) > -1
let b:syntastic_{type}_stamp = [] let b:syntastic_{type}_stamp = []
endif endif
endfor endfor
@ -73,12 +73,12 @@ endfunction " }}}2
function! g:SyntasticNotifiers._initNotifiers() " {{{2 function! g:SyntasticNotifiers._initNotifiers() " {{{2
let self._notifier = {} let self._notifier = {}
for type in s:NOTIFIER_TYPES for type in s:_NOTIFIER_TYPES
let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '') let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
let self._notifier[type] = g:{class}.New() let self._notifier[type] = g:{class}.New()
endfor endfor
let self._enabled_types = copy(s:NOTIFIER_TYPES) let self._enabled_types = copy(s:_NOTIFIER_TYPES)
endfunction " }}}2 endfunction " }}}2
" }}}1 " }}}1

View File

@ -5,7 +5,7 @@ let g:loaded_syntastic_registry = 1
" Initialisation {{{1 " Initialisation {{{1
let s:DEFAULT_CHECKERS = { let s:_DEFAULT_CHECKERS = {
\ 'actionscript':['mxmlc'], \ 'actionscript':['mxmlc'],
\ 'ada': ['gcc'], \ 'ada': ['gcc'],
\ 'applescript': ['osacompile'], \ 'applescript': ['osacompile'],
@ -94,9 +94,9 @@ let s:DEFAULT_CHECKERS = {
\ 'zpt': ['zptlint'], \ 'zpt': ['zptlint'],
\ 'zsh': ['zsh', 'shellcheck'] \ 'zsh': ['zsh', 'shellcheck']
\ } \ }
lockvar! s:DEFAULT_CHECKERS lockvar! s:_DEFAULT_CHECKERS
let s:DEFAULT_FILETYPE_MAP = { let s:_DEFAULT_FILETYPE_MAP = {
\ 'gentoo-metadata': 'xml', \ 'gentoo-metadata': 'xml',
\ 'groff': 'nroff', \ 'groff': 'nroff',
\ 'lhaskell': 'haskell', \ 'lhaskell': 'haskell',
@ -106,7 +106,7 @@ let s:DEFAULT_FILETYPE_MAP = {
\ 'sgml': 'docbk', \ 'sgml': 'docbk',
\ 'sgmllnx': 'docbk', \ 'sgmllnx': 'docbk',
\ } \ }
lockvar! s:DEFAULT_FILETYPE_MAP lockvar! s:_DEFAULT_FILETYPE_MAP
let g:SyntasticRegistry = {} let g:SyntasticRegistry = {}
@ -152,7 +152,7 @@ function! g:SyntasticRegistry.getCheckers(ftalias, hints_list) " {{{2
\ !empty(a:hints_list) ? syntastic#util#unique(a:hints_list) : \ !empty(a:hints_list) ? syntastic#util#unique(a:hints_list) :
\ exists('b:syntastic_checkers') ? b:syntastic_checkers : \ exists('b:syntastic_checkers') ? b:syntastic_checkers :
\ exists('g:syntastic_' . ft . '_checkers') ? g:syntastic_{ft}_checkers : \ exists('g:syntastic_' . ft . '_checkers') ? g:syntastic_{ft}_checkers :
\ get(s:DEFAULT_CHECKERS, ft, 0) \ get(s:_DEFAULT_CHECKERS, ft, 0)
return type(names) == type([]) ? return type(names) == type([]) ?
\ self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]] \ self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]]
@ -165,9 +165,9 @@ function! g:SyntasticRegistry.getCheckersAvailable(ftalias, hints_list) " {{{2
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticRegistry.getKnownFiletypes() " {{{2 function! g:SyntasticRegistry.getKnownFiletypes() " {{{2
let types = keys(s:DEFAULT_CHECKERS) let types = keys(s:_DEFAULT_CHECKERS)
call extend(types, keys(s:DEFAULT_FILETYPE_MAP)) call extend(types, keys(s:_DEFAULT_FILETYPE_MAP))
if exists('g:syntastic_filetype_map') if exists('g:syntastic_filetype_map')
call extend(types, keys(g:syntastic_filetype_map)) call extend(types, keys(g:syntastic_filetype_map))
@ -262,7 +262,7 @@ endfunction " }}}2
"resolve filetype aliases, and replace - with _ otherwise we cant name "resolve filetype aliases, and replace - with _ otherwise we cant name
"syntax checker functions legally for filetypes like "gentoo-metadata" "syntax checker functions legally for filetypes like "gentoo-metadata"
function! s:_normaliseFiletype(ftalias) " {{{2 function! s:_normaliseFiletype(ftalias) " {{{2
let ft = get(s:DEFAULT_FILETYPE_MAP, a:ftalias, a:ftalias) let ft = get(s:_DEFAULT_FILETYPE_MAP, a:ftalias, a:ftalias)
let ft = get(g:syntastic_filetype_map, ft, ft) let ft = get(g:syntastic_filetype_map, ft, ft)
let ft = substitute(ft, '\m-', '_', 'g') let ft = substitute(ft, '\m-', '_', 'g')
return ft return ft

View File

@ -36,7 +36,7 @@ function! g:SyntasticSignsNotifier.enabled() " {{{2
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticSignsNotifier.refresh(loclist) " {{{2 function! g:SyntasticSignsNotifier.refresh(loclist) " {{{2
call syntastic#log#debug(g:SYNTASTIC_DEBUG_NOTIFICATIONS, 'signs: refresh') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'signs: refresh')
let old_signs = copy(self._bufSignIds()) let old_signs = copy(self._bufSignIds())
if self.enabled() if self.enabled()
call self._signErrors(a:loclist) call self._signErrors(a:loclist)