diff runtime/filetype.vim @ 5425:9521463d4fc1

Update runtime files.
author Bram Moolenaar <bram@vim.org>
date Sun, 03 Nov 2013 21:14:31 +0100
parents ab1508486b12
children 0c37f66b4f3b
line wrap: on
line diff
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2013 Sep 22
+" Last Change:	2013 Oct 06
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -2061,14 +2061,15 @@ au BufNewFile,BufRead */etc/sudoers,sudo
 " SVG (Scalable Vector Graphics)
 au BufNewFile,BufRead *.svg			setf svg
 
-" If the file has an extension of 't' and is in a directory 't' then it is
-" almost certainly a Perl test file.
+" If the file has an extension of 't' and is in a directory 't' or 'xt' then
+" it is almost certainly a Perl test file.
 " If the first line starts with '#' and contains 'perl' it's probably a Perl
 " file.
 " (Slow test) If a file contains a 'use' statement then it is almost certainly
 " a Perl file.
 func! s:FTperl()
-  if expand("%:e") == 't' && expand("%:p:h:t") == 't'
+  let dirname = expand("%:p:h:t")
+  if expand("%:e") == 't' && (dirname == 't' || dirname == 'xt')
     setf perl
     return 1
   endif