From 3b798d3002e0b35a5f8890d29035fc91642fd6e0 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 26 Jun 2019 12:34:35 -0700 Subject: filetype: Match known filenames exactly Otherwise, a file like `passwd.c` will match both ansi_c and dsv. The one that gets chosen depends on the iteration order of table, which is non-deterministic. --- lua/plugins/filetype.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lua') diff --git a/lua/plugins/filetype.lua b/lua/plugins/filetype.lua index 6c574bc..35912f6 100644 --- a/lua/plugins/filetype.lua +++ b/lua/plugins/filetype.lua @@ -102,13 +102,13 @@ vis.ftdetect.filetypes = { ext = { "%.d$", "%.di$" }, }, dockerfile = { - ext = { "Dockerfile" }, + ext = { "^Dockerfile$", "%.Dockerfile$" }, }, dot = { ext = { "%.dot$" }, }, dsv = { - ext = { "group", "gshadow", "passwd", "shadow" }, + ext = { "^group$", "^gshadow$", "^passwd$", "^shadow$" }, }, eiffel = { ext = { "%.e$", "%.eif$" }, @@ -282,7 +282,7 @@ vis.ftdetect.filetypes = { ext = { "%.pike$", "%.pmod$" }, }, pkgbuild = { - ext = { "PKGBUILD" }, + ext = { "^PKGBUILD$" }, }, pony = { ext = { "%.pony$" }, -- cgit v1.2.3