summary refs log tree commit diff
path: root/bin/hi.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-02-10 20:34:20 -0500
committerJune McEnroe <june@causal.agency>2019-02-10 20:34:20 -0500
commit1c59f25f3e067da9b4180e501ea2adb66f4658df (patch)
tree688bd4d6902bd0643332cda10477f48c1d178217 /bin/hi.c
parentDon't match DQ string inside SQ string (diff)
downloadsrc-1c59f25f3e067da9b4180e501ea2adb66f4658df.tar.gz
src-1c59f25f3e067da9b4180e501ea2adb66f4658df.zip
Add plain text "language" to hi
Diffstat (limited to '')
-rw-r--r--bin/hi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/hi.c b/bin/hi.c
index d071a876..572276f7 100644
--- a/bin/hi.c
+++ b/bin/hi.c
@@ -213,6 +213,7 @@ static const struct Language {
 	{ "make", "[.]mk$|^Makefile$", MakeSyntax, ARRAY_LEN(MakeSyntax) },
 	{ "mdoc", "[.][1-9]$", MdocSyntax, ARRAY_LEN(MdocSyntax) },
 	{ "sh",   "[.]sh$", ShSyntax, ARRAY_LEN(ShSyntax) },
+	{ "text", "[.]txt$", NULL, 0 },
 };
 
 static regex_t compile(const char *pattern, int flags) {
@@ -634,7 +635,7 @@ int main(int argc, char *argv[]) {
 		name = strrchr(path, '/');
 		name = (name ? &name[1] : path);
 	}
-	if (!lang.syntax && !matchLanguage(&lang, name)) {
+	if (!lang.name && !matchLanguage(&lang, name)) {
 		errx(EX_USAGE, "cannot infer language for %s", name);
 	}
 	if (!opts[Title]) opts[Title] = name;