Skip checking files if no filename was provided to syntax.get

This commit is contained in:
Guldoman
2023-08-19 13:29:48 +08:00
committed by takase1121
parent b5617a3eef
commit e9678cc140
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ local function find(string, field)
end
function syntax.get(filename, header)
return find(filename, "files")
return (filename and find(filename, "files"))
or (header and find(header, "headers"))
or plain_text_syntax
end