r215 - in trunk/vim/debian: . patches

James Vega jamessan-guest@costa.debian.org
Fri, 20 May 2005 16:54:10 +0000


Author: jamessan-guest
Date: 2005-05-20 16:54:09 +0000 (Fri, 20 May 2005)
New Revision: 215

Modified:
   trunk/vim/debian/changelog
   trunk/vim/debian/patches/127_scripts.vim.diff
Log:
Update scripts.vim patch so that it recognizes #!/usr/bin/env hashbang lines.


Modified: trunk/vim/debian/changelog
===================================================================
--- trunk/vim/debian/changelog	2005-05-20 14:16:59 UTC (rev 214)
+++ trunk/vim/debian/changelog	2005-05-20 16:54:09 UTC (rev 215)
@@ -5,7 +5,8 @@
       Removed compression detection for FileAppendPre since there's no good
       way to retrieve the necessary information.
     + Added patch 127_scripts.vim.diff, makes Vim automatically set the proper
-      filetype when editing lua scripts. (closes: #309859)
+      filetype when editing lua scripts.  The patch also enables recognition
+      of "#!/usr/bin/env xxx" hashbang lines.  (closes: #309859)
 
  -- Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>  Fri, 20 May 2005 10:10:45 -0400
 

Modified: trunk/vim/debian/patches/127_scripts.vim.diff
===================================================================
--- trunk/vim/debian/patches/127_scripts.vim.diff	2005-05-20 14:16:59 UTC (rev 214)
+++ trunk/vim/debian/patches/127_scripts.vim.diff	2005-05-20 16:54:09 UTC (rev 215)
@@ -1,7 +1,22 @@
 diff -ur vim63.orig/runtime/scripts.vim vim63/runtime/scripts.vim
 --- vim63.orig/runtime/scripts.vim	2004-04-18 06:54:30.000000000 -0400
 +++ vim63/runtime/scripts.vim	2005-05-20 10:04:08.000000000 -0400
-@@ -86,6 +86,10 @@
+@@ -40,10 +40,14 @@
+ 
+   " Get the program name.
+   " Only accept spaces in PC style paths: "#!c:/program files/perl [args]".
++  " If the word env is used, use the first word after the space:
++  " "#!/usr/bin/env perl [path/args]"
+   " If there is no path use the first word: "#!perl [path/args]".
+   " Otherwise get the last word after a slash: "#!/usr/bin/perl [path/args]".
+   if s:line1 =~ '^#!\s*\a:[/\\]'
+     let s:name = substitute(s:line1, '^#!.*[/\\]\(\i\+\).*', '\1', '')
++  elseif s:line1 =~ '^#!.*\<env\>'
++    let s:name = substitute(s:line1, '^#!.*\<env\>\s\+\(\i\+\).*', '\1', '')
+   elseif s:line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
+     let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
+   else
+@@ -86,6 +90,10 @@
    elseif s:name =~ 'make\>'
      set ft=make