vim-patch:8.2.4064: foam files are not detected (#17041)

* vim-patch:8.2.4064: foam files are not detected

Problem:    Foam files are not detected.
Solution:   Detect the foam filetype by the path and file contents. (Mohammed
            Elwardi Fadeli, closes vim/vim#9501)
2284f6cca3

* Port foam ft detection to filetype.lua

Co-authored-by: Gregory Anders <greg@gpanders.com>
This commit is contained in:
Christian Clason
2022-01-11 21:02:58 +01:00
committed by GitHub
parent 074b033e7e
commit 70fe3ce004
4 changed files with 82 additions and 0 deletions

View File

@@ -860,6 +860,10 @@ local filename = {
["exim.conf"] = "exim",
exports = "exports",
[".fetchmailrc"] = "fetchmail",
fvSchemes = function() vim.fn["dist#ft#FTfoam"]() end,
fvSolution = function() vim.fn["dist#ft#FTfoam"]() end,
fvConstraints = function() vim.fn["dist#ft#FTfoam"]() end,
fvModels = function() vim.fn["dist#ft#FTfoam"]() end,
fstab = "fstab",
mtab = "fstab",
[".gdbinit"] = "gdb",
@@ -1334,6 +1338,14 @@ local pattern = {
["zlog.*"] = starsetf('zsh'),
["zsh.*"] = starsetf('zsh'),
["ae%d+%.txt"] = 'mail',
["[a-zA-Z0-9]*Dict"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z0-9]*Dict%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z]*Properties"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z]*Properties%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*Transport%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*/constant/g"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*/0/.*"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*/0%.orig/.*"] = function() vim.fn["dist#ft#FTfoam"]() end,
-- END PATTERN
}
-- luacheck: pop