Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Call string.match like the rest of the highlighter
Diffstat (limited to 'custom')
-rw-r--r--custom/extensions/syntax-highlight.lua2
1 file changed, 1 insertion, 1 deletion
diff --git a/custom/extensions/syntax-highlight.lua b/custom/extensions/syntax-highlight.lua
index 8a1e7ab..6605d71 100644
--- a/custom/extensions/syntax-highlight.lua
+++ b/custom/extensions/syntax-highlight.lua
@@ -187,7 +187,7 @@ local function lexer_for(name, text)
if type(scintillua.detect) == "function" then
-- The first line goes along, so a script with no extension is still
-- known by its shebang.
- local ok, lang = pcall(scintillua.detect, name, text:match("^[^\n]*"))
+ local ok, lang = pcall(scintillua.detect, name, string.match(text, "^[^\n]*"))
if ok and lang then
local lexer = load_lexer_name(lang)
if lexer then