From 5830b7d9f0aeb5bfc3eed8011ebcf0d4ca9caf08 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Thu, 17 Mar 2022 00:14:36 -0400 Subject: [PATCH] plugin detectindent: pre-compile regexes --- data/plugins/detectindent.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/plugins/detectindent.lua b/data/plugins/detectindent.lua index 119601f0..ea9c8b28 100644 --- a/data/plugins/detectindent.lua +++ b/data/plugins/detectindent.lua @@ -116,10 +116,10 @@ local function get_comment_patterns(syntax) end if type(pattern.regex) == "table" then table.insert(comments, { - "r", startp, pattern.regex[2] + "r", regex.compile(startp), regex.compile(pattern.regex[2]) }) elseif not_is_string then - table.insert(comments, {"r", startp}) + table.insert(comments, {"r", regex.compile(startp)}) end end elseif pattern.syntax then