]> granicus.if.org Git - vim/commitdiff
patch 8.2.2041: haskell filetype not optimally recognized v8.2.2041
authorBram Moolenaar <Bram@vim.org>
Tue, 24 Nov 2020 19:13:26 +0000 (20:13 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 24 Nov 2020 19:13:26 +0000 (20:13 +0100)
Problem:    Haskell filetype not optimally recognized.
Solution:   Recognize all *.hsc files as Haskell. (Marcin Szamotulski,
            closes #7354)

runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index 35b73f9292b9975e7ff621a2ddc4a3109f4899f0..3073c9a6b201077662722b2e62e0793687bf339b 100644 (file)
@@ -697,15 +697,9 @@ au BufNewFile,BufRead *.haml                       setf haml
 
 " Hamster Classic | Playground files
 au BufNewFile,BufRead *.hsm                    setf hamster
-au BufNewFile,BufRead *.hsc
-       \ if match(join(getline(1,10), "\n"), '\%(^\|\n\)\s*\%({-#\_s*LANGUAGE\>\|\<module\>\)') != -1 |
-       \   setf haskell |
-       \ else |
-       \   setf hamster |
-       \ endif
 
 " Haskell
-au BufNewFile,BufRead *.hs,*.hs-boot           setf haskell
+au BufNewFile,BufRead *.hs,*.hsc,*.hs-boot     setf haskell
 au BufNewFile,BufRead *.lhs                    setf lhaskell
 au BufNewFile,BufRead *.chs                    setf chaskell
 au BufNewFile,BufRead cabal.project            setf cabalproject
index f3f622eb449462b34f73fb163e50bf6bf2c64e27..15ba59ae9fbb89331ac51367534113c8bdc43ffd 100644 (file)
@@ -204,8 +204,8 @@ let s:filename_checks = {
     \ 'gsp': ['file.gsp'],
     \ 'gtkrc': ['.gtkrc', 'gtkrc', '.gtkrc-file', 'gtkrc-file'],
     \ 'haml': ['file.haml'],
-    \ 'hamster': ['file.hsc', 'file.hsm'],
-    \ 'haskell': ['file.hs', 'file.hs-boot'],
+    \ 'hamster': ['file.hsm'],
+    \ 'haskell': ['file.hs', 'file.hsc', 'file.hs-boot'],
     \ 'haste': ['file.ht'],
     \ 'hastepreproc': ['file.htpp'],
     \ 'hb': ['file.hb'],
index 19757ca0588f905a49d55cf908664537b3c37cf9..ab2300bd4cb7c074742db8573ecb01018018eb20 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2041,
 /**/
     2040,
 /**/