diff options
| author | Michael Forney <mforney@mforney.org> | 2019-06-26 17:37:17 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2019-06-26 17:37:17 -0700 |
| commit | e5fadf759e6a812455091109271a1ab8f1c992b0 (patch) | |
| tree | cd682125cffdbbfbe40cf43978ba39baa2ca64c4 /pkg/vis/patch | |
| parent | 20f06d69798df9d6d377931d97b9533cc94b7c53 (diff) | |
vis: Fix filetype detection for fixed filenames
Diffstat (limited to 'pkg/vis/patch')
| -rw-r--r-- | pkg/vis/patch/0001-filetype-Match-known-filenames-exactly.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pkg/vis/patch/0001-filetype-Match-known-filenames-exactly.patch b/pkg/vis/patch/0001-filetype-Match-known-filenames-exactly.patch new file mode 100644 index 00000000..bfb16d89 --- /dev/null +++ b/pkg/vis/patch/0001-filetype-Match-known-filenames-exactly.patch @@ -0,0 +1,44 @@ +From 0258112511c3a268f06e95bab93f96f03ca5df4f Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Wed, 26 Jun 2019 12:34:35 -0700 +Subject: [PATCH] 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(-) + +diff --git a/lua/plugins/filetype.lua b/lua/plugins/filetype.lua +index ba770aa..a820a0e 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$" }, + }, + dot = { + ext = { "%.dot$" }, + }, + dsv = { +- ext = { "group", "gshadow", "passwd", "shadow" }, ++ ext = { "^group$", "^gshadow$", "^passwd$", "^shadow$" }, + }, + eiffel = { + ext = { "%.e$", "%.eif$" }, +@@ -279,7 +279,7 @@ vis.ftdetect.filetypes = { + ext = { "%.pike$", "%.pmod$" }, + }, + pkgbuild = { +- ext = { "PKGBUILD" }, ++ ext = { "^PKGBUILD$" }, + }, + pony = { + ext = { "%.pony$" }, +-- +2.22.0 + |
