summaryrefslogtreecommitdiffstats
path: root/runtime/filetype.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-05-28 14:49:58 +0000
committerBram Moolenaar <Bram@vim.org>2008-05-28 14:49:58 +0000
commitaebaf89fd4626e52dee4a6bb4cdec8dbf2556bd2 (patch)
tree2afe10fdf37a9f22f6f948a7ca56c35cbdc01bb6 /runtime/filetype.vim
parent7a9892558776b37077b4a889364cef1c7902cba2 (diff)
updated for version 7.1-299v7.1.299
Diffstat (limited to 'runtime/filetype.vim')
-rw-r--r--runtime/filetype.vim13
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 20719aa2e4..e20a53aed4 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -16,20 +16,23 @@ set cpo&vim
augroup filetypedetect
" Ignored extensions
+if exists("*fnameescape")
au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.rpmsave,?\+.rpmnew
- \ exe "doau filetypedetect BufRead " . expand("<afile>:r")
+ \ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r"))
au BufNewFile,BufRead *~
\ let s:name = expand("<afile>") |
\ let s:short = substitute(s:name, '\~$', '', '') |
\ if s:name != s:short && s:short != "" |
- \ exe "doau filetypedetect BufRead " . s:short |
+ \ exe "doau filetypedetect BufRead " . fnameescape(s:short) |
\ endif |
- \ unlet s:name |
- \ unlet s:short
+ \ unlet s:name s:short
au BufNewFile,BufRead ?\+.in
\ if expand("<afile>:t") != "configure.in" |
- \ exe "doau filetypedetect BufRead " . expand("<afile>:r") |
+ \ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r")) |
\ endif
+elseif &verbose > 0
+ echomsg "Warning: some filetypes will not be recognized because this version of Vim does not have fnameescape()"
+endif
" Pattern used to match file names which should not be inspected.
" Currently finds compressed files.