Skip to content

Commit a09bee3

Browse files
committed
patch 8.2.2041: haskell filetype not optimally recognized
Problem: Haskell filetype not optimally recognized. Solution: Recognize all *.hsc files as Haskell. (Marcin Szamotulski, closes #7354)
1 parent c9f8b84 commit a09bee3

3 files changed

Lines changed: 5 additions & 9 deletions

File tree

runtime/filetype.vim

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -697,15 +697,9 @@ au BufNewFile,BufRead *.haml setf haml
697697

698698
" Hamster Classic | Playground files
699699
au BufNewFile,BufRead *.hsm setf hamster
700-
au BufNewFile,BufRead *.hsc
701-
\ if match(join(getline(1,10), "\n"), '\%(^\|\n\)\s*\%({-#\_s*LANGUAGE\>\|\<module\>\)') != -1 |
702-
\ setf haskell |
703-
\ else |
704-
\ setf hamster |
705-
\ endif
706700

707701
" Haskell
708-
au BufNewFile,BufRead *.hs,*.hs-boot setf haskell
702+
au BufNewFile,BufRead *.hs,*.hsc,*.hs-boot setf haskell
709703
au BufNewFile,BufRead *.lhs setf lhaskell
710704
au BufNewFile,BufRead *.chs setf chaskell
711705
au BufNewFile,BufRead cabal.project setf cabalproject

src/testdir/test_filetype.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ let s:filename_checks = {
204204
\ 'gsp': ['file.gsp'],
205205
\ 'gtkrc': ['.gtkrc', 'gtkrc', '.gtkrc-file', 'gtkrc-file'],
206206
\ 'haml': ['file.haml'],
207-
\ 'hamster': ['file.hsc', 'file.hsm'],
208-
\ 'haskell': ['file.hs', 'file.hs-boot'],
207+
\ 'hamster': ['file.hsm'],
208+
\ 'haskell': ['file.hs', 'file.hsc', 'file.hs-boot'],
209209
\ 'haste': ['file.ht'],
210210
\ 'hastepreproc': ['file.htpp'],
211211
\ 'hb': ['file.hb'],

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2041,
753755
/**/
754756
2040,
755757
/**/

0 commit comments

Comments
 (0)