Skip to content

Commit

Permalink
fix literal makefile name detection
Browse files Browse the repository at this point in the history
The current literal file name detection for GNUmakefile, makefile
or Makefile could match anywhere in the file name.

For example the file type of `makefile.lua` (the name of our makefile lexer)
was detected as makefile.

This is fixed by requiring the literal patterns to start and end with
the string.
  • Loading branch information
fischerling authored and rnpnr committed Oct 5, 2023
1 parent 3d83d77 commit 7445c33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/plugins/filetype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ vis.ftdetect.filetypes = {
makefile = {
hashbang = {"^#!/usr/bin/make"},
utility = {"^make$"},
ext = { "%.iface$", "%.mak$", "%.mk$", "GNUmakefile", "makefile", "Makefile" },
ext = { "%.iface$", "%.mak$", "%.mk$", "^GNUmakefile$", "^makefile$", "^Makefile$" },
mime = { "text/x-makefile" },
},
man = {
Expand Down

0 comments on commit 7445c33

Please sign in to comment.