Thanks to visit codestin.com
Credit goes to github.com

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

Commit d1b4016

Browse files
committed
Bug fix: glob(), globpath(), and expand() should ignore wildignore.
1 parent 50f6b47 commit d1b4016

38 files changed

Lines changed: 77 additions & 77 deletions

File tree

autoload/syntastic/c.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ endfunction " }}}2
208208
" resolve user CFLAGS
209209
function! s:_get_cflags(ft, ck, opts) " {{{2
210210
" determine whether to parse header files as well
211-
if has_key(a:opts, 'header_names') && expand('%') =~? a:opts['header_names']
211+
if has_key(a:opts, 'header_names') && expand('%', 1) =~? a:opts['header_names']
212212
if s:_get_checker_var('g', a:ft, a:ck, 'check_header', 0)
213213
let flags = get(a:opts, 'header_flags', '') . ' -c ' . syntastic#c#NullOutput()
214214
else
@@ -297,7 +297,7 @@ function! s:_search_headers() " {{{2
297297
" search included headers
298298
for hfile in files
299299
if hfile != ''
300-
let filename = expand('%:p:h') . syntastic#util#Slash() . hfile
300+
let filename = expand('%:p:h', 1) . syntastic#util#Slash() . hfile
301301

302302
try
303303
let lines = readfile(filename, '', 100)

autoload/syntastic/log.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function! s:_logRedirect(on) " {{{2
143143
if exists("g:syntastic_debug_file")
144144
if a:on
145145
try
146-
execute 'redir >> ' . fnameescape(expand(g:syntastic_debug_file))
146+
execute 'redir >> ' . fnameescape(expand(g:syntastic_debug_file, 1))
147147
catch /\m^Vim\%((\a\+)\)\=:/
148148
silent! redir END
149149
unlet g:syntastic_debug_file

autoload/syntastic/preprocess.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ endfunction " }}}2
3030

3131
function! syntastic#preprocess#checkstyle(errors) " {{{2
3232
let out = []
33-
let fname = expand('%')
33+
let fname = expand('%', 1)
3434
for err in a:errors
3535
if match(err, '\m<error\>') > -1
3636
let line = str2nr(matchstr(err, '\m\<line="\zs\d\+\ze"'))

autoload/syntastic/util.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function! syntastic#util#findInParent(what, where) " {{{2
223223

224224
let old = ''
225225
while here != ''
226-
let p = split(globpath(here, a:what), '\n')
226+
let p = split(globpath(here, a:what, 1), '\n')
227227

228228
if !empty(p)
229229
return fnamemodify(p[0], ':p')
@@ -260,8 +260,8 @@ function! syntastic#util#shescape(string) " {{{2
260260
endfunction " }}}2
261261

262262
" A less noisy shellescape(expand())
263-
function! syntastic#util#shexpand(string) " {{{2
264-
return syntastic#util#shescape(expand(a:string))
263+
function! syntastic#util#shexpand(string, ...) " {{{2
264+
return syntastic#util#shescape(a:0 ? expand(a:string, a:1) : expand(a:string, 1))
265265
endfunction " }}}2
266266

267267
" decode XML entities
@@ -343,7 +343,7 @@ function! s:_rmrf(what) " {{{2
343343
endif
344344

345345
if getftype(a:what) ==# 'dir'
346-
for f in split(globpath(a:what, '*'), "\n")
346+
for f in split(globpath(a:what, '*', 1), "\n")
347347
call s:_rmrf(f)
348348
endfor
349349
silent! call system(s:rmdir . ' ' . syntastic#util#shescape(a:what))

plugin/syntastic.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ endfunction " }}}2
607607

608608
" Skip running in special buffers
609609
function! s:_skip_file() " {{{2
610-
let fname = expand('%')
610+
let fname = expand('%', 1)
611611
let skip = get(b:, 'syntastic_skip_checks', 0) || (&buftype != '') ||
612612
\ !filereadable(fname) || getwinvar(0, '&diff') || s:_ignore_file(fname) ||
613613
\ fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions
@@ -621,7 +621,7 @@ endfunction " }}}2
621621
function! s:_explain_skip(filetypes) " {{{2
622622
if empty(a:filetypes) && s:_skip_file()
623623
let why = []
624-
let fname = expand('%')
624+
let fname = expand('%', 1)
625625

626626
if get(b:, 'syntastic_skip_checks', 0)
627627
call add(why, 'b:syntastic_skip_checks set')

plugin/syntastic/checker.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ endfunction " }}}2
5151
function! g:SyntasticChecker.getExec() " {{{2
5252
return
5353
\ expand( exists('b:syntastic_' . self._name . '_exec') ? b:syntastic_{self._name}_exec :
54-
\ syntastic#util#var(self._filetype . '_' . self._name . '_exec', self._exec) )
54+
\ syntastic#util#var(self._filetype . '_' . self._name . '_exec', self._exec), 1 )
5555
endfunction " }}}2
5656

5757
function! g:SyntasticChecker.getExecEscaped() " {{{2

syntax_checkers/ada/gcc.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function! SyntaxCheckers_ada_gcc_IsAvailable() dict
2323
if !exists('g:syntastic_ada_compiler')
2424
let g:syntastic_ada_compiler = self.getExec()
2525
endif
26-
return executable(expand(g:syntastic_ada_compiler))
26+
return executable(expand(g:syntastic_ada_compiler, 1))
2727
endfunction
2828

2929
function! SyntaxCheckers_ada_gcc_GetLocList() dict

syntax_checkers/asm/gcc.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function! SyntaxCheckers_asm_gcc_IsAvailable() dict
2626
if !exists('g:syntastic_asm_compiler')
2727
let g:syntastic_asm_compiler = self.getExec()
2828
endif
29-
return executable(expand(g:syntastic_asm_compiler))
29+
return executable(expand(g:syntastic_asm_compiler, 1))
3030
endfunction
3131

3232
function! SyntaxCheckers_asm_gcc_GetLocList() dict
@@ -41,7 +41,7 @@ endfunction
4141

4242
function! s:GetDialect()
4343
return exists('g:syntastic_asm_dialect') ? g:syntastic_asm_dialect :
44-
\ expand('%:e') ==? 'asm' ? 'intel' : 'att'
44+
\ expand('%:e', 1) ==? 'asm' ? 'intel' : 'att'
4545
endfunction
4646

4747
call g:SyntasticRegistry.CreateAndRegisterChecker({

syntax_checkers/c/gcc.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function! SyntaxCheckers_c_gcc_IsAvailable() dict
2727
let g:syntastic_c_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
2828
endif
2929
call self.log('g:syntastic_c_compiler =', g:syntastic_c_compiler)
30-
return executable(expand(g:syntastic_c_compiler))
30+
return executable(expand(g:syntastic_c_compiler, 1))
3131
endfunction
3232

3333
function! SyntaxCheckers_c_gcc_GetLocList() dict

syntax_checkers/cabal/cabal.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function! SyntaxCheckers_cabal_cabal_GetLocList() dict
4040
return SyntasticMake({
4141
\ 'makeprg': makeprg,
4242
\ 'errorformat': errorformat,
43-
\ 'cwd': expand('%:p:h'),
43+
\ 'cwd': expand('%:p:h', 1),
4444
\ 'preprocess': 'cabal',
4545
\ 'defaults': {'bufnr': bufnr('')} })
4646
endfunction

0 commit comments

Comments
 (0)