Bug fix: add support for Vim 7.1.261 and earlier.

This commit is contained in:
LCD 47 2017-07-02 18:37:17 +03:00
parent f459416dc3
commit 49a94fe69f
3 changed files with 19 additions and 12 deletions

View File

@ -76,7 +76,7 @@ function! syntastic#util#tmpdir() abort " {{{2
if (has('unix') || has('mac')) && executable('mktemp') && !has('win32unix')
" TODO: option "-t" to mktemp(1) is not portable
let tmp = $TMPDIR !=# '' ? $TMPDIR : $TMP !=# '' ? $TMP : '/tmp'
let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . getpid() . '-XXXXXXXX'), "\n")
let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . s:fuzz() . '-XXXXXXXX'), "\n")
if v:shell_error == 0 && len(out) == 1
let tempdir = out[0]
endif
@ -84,13 +84,13 @@ function! syntastic#util#tmpdir() abort " {{{2
if tempdir ==# ''
if has('win32') || has('win64')
let tempdir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-' . getpid()
let tempdir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-' . s:fuzz()
elseif has('win32unix')
let tempdir = syntastic#util#CygwinPath('/tmp/vim-syntastic-' . getpid())
let tempdir = syntastic#util#CygwinPath('/tmp/vim-syntastic-' . s:fuzz())
elseif $TMPDIR !=# ''
let tempdir = $TMPDIR . '/vim-syntastic-' . getpid()
let tempdir = $TMPDIR . '/vim-syntastic-' . s:fuzz()
else
let tempdir = '/tmp/vim-syntastic-' . getpid()
let tempdir = '/tmp/vim-syntastic-' . s:fuzz()
endif
try
@ -401,9 +401,6 @@ function! syntastic#util#setLastTick(buf) abort " {{{2
call setbufvar(a:buf, 'syntastic_lasttick', getbufvar(a:buf, 'changedtick'))
endfunction " }}}2
let s:_wid_base = 'syntastic_' . getpid() . '_' . reltimestr(g:_SYNTASTIC_START) . '_'
let s:_wid_pool = 0
" Add unique IDs to windows
function! syntastic#util#setWids() abort " {{{2
for tab in range(1, tabpagenr('$'))
@ -614,8 +611,18 @@ endfunction "}}}2
let s:_getbufvar = function(v:version > 703 || (v:version == 703 && has('patch831')) ? 'getbufvar' : 's:_getbufvar_dumb')
lockvar s:_getbufvar
function! s:_fuzz_dumb() abort " {{{2
return 'tmp'
endfunction " }}}2
let s:_fuzz = function(exists('*getpid') ? 'getpid' : 's:_fuzz_dumb')
lockvar s:_fuzz
" }}}1
let s:_wid_base = 'syntastic_' . s:_fuzz() . '_' . reltimestr(g:_SYNTASTIC_START) . '_'
let s:_wid_pool = 0
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START
endif
let g:_SYNTASTIC_VERSION = '3.8.0-59'
let g:_SYNTASTIC_VERSION = '3.8.0-60'
lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1

View File

@ -19,13 +19,13 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_lisp_clisp_GetLocList() dict
let buf = bufnr('')
let tmpdir = syntastic#util#tmpdir()
let out = tmpdir !=# '.' ? ('-o ' . syntastic#util#shescape(tmpdir . syntastic#util#Slash() . 'syntastic_' . getpid())) : ''
let makeprg = self.makeprgBuild({
\ 'args_after': '-q',
\ 'fname_before': '-c',
\ 'post_args_after': out })
\ 'post_args_after': ['-o', tmpdir] })
let errorformat =
\ '%-G;%.%#,' .
@ -40,7 +40,7 @@ function! SyntaxCheckers_lisp_clisp_GetLocList() dict
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr('')} })
\ 'defaults': {'bufnr': buf} })
call syntastic#util#rmrf(tmpdir)