Make syntastic#util#parseShebang() aware of /usr/bin/env.

This commit is contained in:
LCD 47 2014-07-06 18:18:43 +03:00
parent dd57547da0
commit c325f6c815
2 changed files with 5 additions and 5 deletions

View File

@ -35,12 +35,12 @@ endfunction " }}}2
" "
"{'exe': '/usr/bin/perl', 'args': ['-f', '-bar']} "{'exe': '/usr/bin/perl', 'args': ['-f', '-bar']}
function! syntastic#util#parseShebang() " {{{2 function! syntastic#util#parseShebang() " {{{2
for lnum in range(1,5) for lnum in range(1, 5)
let line = getline(lnum) let line = getline(lnum)
if line =~ '^#!' if line =~ '^#!'
let exe = matchstr(line, '\m^#!\s*\zs[^ \t]*') let line = substitute(line, '\v^#!\s*(\S+/env(\s+-\S+)*\s+)?', '', '')
let args = split(matchstr(line, '\m^#!\s*[^ \t]*\zs.*')) let exe = matchstr(line, '\m^\S*\ze')
let args = split(matchstr(line, '\m^\S*\zs.*'))
return { 'exe': exe, 'args': args } return { 'exe': exe, 'args': args }
endif endif
endfor endfor

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:syntastic_start lockvar! g:syntastic_start
endif endif
let g:syntastic_version = '3.4.0-91' let g:syntastic_version = '3.4.0-92'
lockvar g:syntastic_version lockvar g:syntastic_version
" Sanity checks {{{1 " Sanity checks {{{1