patch 9.0.0012: signature files not detected properly
Problem: Signature files not detected properly.
Solution: Add a function to better detect signature files. (Doug Kearns)
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index d8ddeff..eba95cf 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -313,7 +313,6 @@
\ 'lotos': ['file.lot', 'file.lotos'],
\ 'lout': ['file.lou', 'file.lout'],
\ 'lpc': ['file.lpc', 'file.ulpc'],
- \ 'lprolog': ['file.sig'],
\ 'lsl': ['file.lsl'],
\ 'lss': ['file.lss'],
\ 'lua': ['file.lua', 'file.rockspec', 'file.nse'],
@@ -1760,4 +1759,59 @@
filetype off
endfunc
+func Test_sig_file()
+ filetype on
+
+ call writefile(['this is neither Lambda Prolog nor SML'], 'Xfile.sig')
+ split Xfile.sig
+ call assert_equal('', &filetype)
+ bwipe!
+
+ " Test dist#ft#FTsig()
+
+ let g:filetype_sig = 'sml'
+ split Xfile.sig
+ call assert_equal('sml', &filetype)
+ bwipe!
+ unlet g:filetype_sig
+
+ " Lambda Prolog
+
+ call writefile(['sig foo.'], 'Xfile.sig')
+ split Xfile.sig
+ call assert_equal('lprolog', &filetype)
+ bwipe!
+
+ call writefile(['/* ... */'], 'Xfile.sig')
+ split Xfile.sig
+ call assert_equal('lprolog', &filetype)
+ bwipe!
+
+ call writefile(['% ...'], 'Xfile.sig')
+ split Xfile.sig
+ call assert_equal('lprolog', &filetype)
+ bwipe!
+
+ " SML signature file
+
+ call writefile(['signature FOO ='], 'Xfile.sig')
+ split Xfile.sig
+ call assert_equal('sml', &filetype)
+ bwipe!
+
+ call writefile(['structure FOO ='], 'Xfile.sig')
+ split Xfile.sig
+ call assert_equal('sml', &filetype)
+ bwipe!
+
+ call writefile(['(* ... *)'], 'Xfile.sig')
+ split Xfile.sig
+ call assert_equal('sml', &filetype)
+ bwipe!
+
+ call delete('Xfile.sig')
+ filetype off
+endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index 11fd817..116113b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -736,6 +736,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 12,
+/**/
11,
/**/
10,