api: fix capture index on strings with brackets

This commit is contained in:
shagu
2018-12-02 17:16:31 +01:00
parent e59b1bd6d9
commit bf8bb3163e
+1 -1
View File
@@ -129,7 +129,7 @@ local capture_cache = {}
function pfUI.api.GetCaptures(pat)
local r = capture_cache
if not r[pat] then
for a, b, c, d, e in string.gfind(pat, gsub(pat, "%d%$", "%%(.-)$")) do
for a, b, c, d, e in string.gfind(gsub(pat, "%((.+)%)", "%1"), gsub(pat, "%d%$", "%%(.-)$")) do
r[pat] = { a, b, c, d, e}
end
end