From c325f6c8152d0ea643e549df3dbd43b9668a141a Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Sun, 6 Jul 2014 18:18:43 +0300 Subject: [PATCH] Make syntastic#util#parseShebang() aware of /usr/bin/env. --- autoload/syntastic/util.vim | 8 ++++---- plugin/syntastic.vim | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/autoload/syntastic/util.vim b/autoload/syntastic/util.vim index b4b900b1..982366c4 100644 --- a/autoload/syntastic/util.vim +++ b/autoload/syntastic/util.vim @@ -35,12 +35,12 @@ endfunction " }}}2 " "{'exe': '/usr/bin/perl', 'args': ['-f', '-bar']} function! syntastic#util#parseShebang() " {{{2 - for lnum in range(1,5) + for lnum in range(1, 5) let line = getline(lnum) - if line =~ '^#!' - let exe = matchstr(line, '\m^#!\s*\zs[^ \t]*') - let args = split(matchstr(line, '\m^#!\s*[^ \t]*\zs.*')) + let line = substitute(line, '\v^#!\s*(\S+/env(\s+-\S+)*\s+)?', '', '') + let exe = matchstr(line, '\m^\S*\ze') + let args = split(matchstr(line, '\m^\S*\zs.*')) return { 'exe': exe, 'args': args } endif endfor diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 3b42ee64..5e84bd9e 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:syntastic_start endif -let g:syntastic_version = '3.4.0-91' +let g:syntastic_version = '3.4.0-92' lockvar g:syntastic_version " Sanity checks {{{1