diff runtime/scripts.vim @ 2034:7bc41231fbc7

Update runtime files.
author Bram Moolenaar <bram@zimbu.org>
date Wed, 06 Jan 2010 20:54:52 +0100
parents 33d28f1c4d1d
children aaa953373c91
line wrap: on
line diff
--- a/runtime/scripts.vim
+++ b/runtime/scripts.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types in scripts
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last change:	2008 Aug 09
+" Last change:	2009 Dec 24
 
 " This file is called by an autocommand for every file that has just been
 " loaded into a buffer.  It checks if the type of file can be recognized by
@@ -318,30 +318,31 @@ else
     set ft=scheme
 
   " Git output
-  elseif s:line1 =~ '^\(commit\|tree\|object\) \x\{40\}$\|^tag \S\+$'
+  elseif s:line1 =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$'
     set ft=git
 
   " CVS diff
   else
-    let lnum = 1
-    while getline(lnum) =~ "^? " && lnum < line("$")
-      let lnum = lnum + 1
+    let s:lnum = 1
+    while getline(s:lnum) =~ "^? " && s:lnum < line("$")
+      let s:lnum += 1
     endwhile
-    if getline(lnum) =~ '^Index:\s\+\f\+$'
+    if getline(s:lnum) =~ '^Index:\s\+\f\+$'
       set ft=diff
 
       " locale input files: Formal Definitions of Cultural Conventions
       " filename must be like en_US, fr_FR@euro or en_US.UTF-8
     elseif expand("%") =~ '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_'
-      let lnum = 1
-      while lnum < 100 && lnum < line("$")
-	if getline(lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$'
+      let s:lnum = 1
+      while s:lnum < 100 && s:lnum < line("$")
+	if getline(s:lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$'
 	  setf fdcc
 	  break
 	endif
-	let lnum = lnum + 1
+	let s:lnum += 1
       endwhile
     endif
+    unlet s:lnum
 
   endif