• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisionf39f960f3ea0226132f978fa01b11e72233031f0 (tree)
Zeit2020-11-23 00:00:04
AutorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.2032: cabalconfig and cabalproject filetypes not recognized

Commit: https://github.com/vim/vim/commit/dcbab75db3ba5e812f119e08cda6a02c6b028a14
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 22 15:51:24 2020 +0100

patch 8.2.2032: cabalconfig and cabalproject filetypes not recognized
Problem: Cabalconfig and cabalproject filetypes not recognized.
Solution: Detect more cabal files. (Marcin Szamotulski, closes https://github.com/vim/vim/issues/7339)

Ändern Zusammenfassung

Diff

diff -r adb0bfdf4be3 -r f39f960f3ea0 runtime/filetype.vim
--- a/runtime/filetype.vim Sun Nov 22 14:30:07 2020 +0100
+++ b/runtime/filetype.vim Sun Nov 22 16:00:04 2020 +0100
@@ -696,12 +696,21 @@
696696 au BufNewFile,BufRead *.haml setf haml
697697
698698 " Hamster Classic | Playground files
699-au BufNewFile,BufRead *.hsc,*.hsm setf hamster
699+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
700706
701707 " Haskell
702708 au BufNewFile,BufRead *.hs,*.hs-boot setf haskell
703709 au BufNewFile,BufRead *.lhs setf lhaskell
704710 au BufNewFile,BufRead *.chs setf chaskell
711+au BufNewFile,BufRead cabal.project setf cabalproject
712+au BufNewFile,BufRead $HOME/.cabal/config setf cabalconfig
713+au BufNewFile,BufRead cabal.config setf cabalconfig
705714
706715 " Haste
707716 au BufNewFile,BufRead *.ht setf haste
@@ -2037,12 +2046,14 @@
20372046
20382047 " Bazel build file
20392048 if !has("fname_case")
2040- au BufNewFile,BufRead *.BUILD,BUILD setf bzl
2049+ au BufNewFile,BufRead *.BUILD,BUILD setf bzl
20412050 endif
20422051
20432052 " BIND zone
20442053 au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone')
20452054
2055+au BufNewFile,BufRead cabal.project.* call s:StarSetf('cabalproject')
2056+
20462057 " Calendar
20472058 au BufNewFile,BufRead */.calendar/*,
20482059 \*/share/calendar/*/calendar.*,*/share/calendar/calendar.*
diff -r adb0bfdf4be3 -r f39f960f3ea0 src/testdir/test_filetype.vim
--- a/src/testdir/test_filetype.vim Sun Nov 22 14:30:07 2020 +0100
+++ b/src/testdir/test_filetype.vim Sun Nov 22 16:00:04 2020 +0100
@@ -87,6 +87,8 @@
8787 \ 'bzr': ['bzr_log.any', 'bzr_log.file'],
8888 \ 'c': ['enlightenment/file.cfg', 'file.qc', 'file.c', 'some-enlightenment/file.cfg'],
8989 \ 'cabal': ['file.cabal'],
90+ \ 'cabalconfig': ['cabal.config'],
91+ \ 'cabalproject': ['cabal.project', 'cabal.project.local'],
9092 \ 'calendar': ['calendar', '/.calendar/file', '/share/calendar/any/calendar.file', '/share/calendar/calendar.file', 'any/share/calendar/any/calendar.file', 'any/share/calendar/calendar.file'],
9193 \ 'catalog': ['catalog', 'sgml.catalogfile', 'sgml.catalog', 'sgml.catalog-file'],
9294 \ 'cdl': ['file.cdl'],
diff -r adb0bfdf4be3 -r f39f960f3ea0 src/version.c
--- a/src/version.c Sun Nov 22 14:30:07 2020 +0100
+++ b/src/version.c Sun Nov 22 16:00:04 2020 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 2032,
755+/**/
754756 2031,
755757 /**/
756758 2030,
Show on old repository browser