vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit ec6c411cc3829fa47196bc217de9b76b3c0b6d20
parent aa26e59b167a9314d387b27cb73565495c3c915b
Author: Michael Forney <mforney@mforney.org>
Date:   Wed, 26 Jun 2019 12:34:35 -0700

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.

Diffstat:
Mlua/plugins/filetype.lua | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 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$" },