Renamed `common.matches_pattern` => `common.match_pattern`
This commit is contained in:
parent
7cdf7dc44f
commit
ae42176953
|
@ -102,12 +102,12 @@ function common.path_suggest(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function common.matches_pattern(text, pattern, ...)
|
function common.match_pattern(text, pattern, ...)
|
||||||
if type(pattern) == "string" then
|
if type(pattern) == "string" then
|
||||||
return text:find(pattern, ...)
|
return text:find(pattern, ...)
|
||||||
end
|
end
|
||||||
for _, p in ipairs(pattern) do
|
for _, p in ipairs(pattern) do
|
||||||
local s, e = common.matches_pattern(text, p, ...)
|
local s, e = common.match_pattern(text, p, ...)
|
||||||
if s then return s, e end
|
if s then return s, e end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -14,7 +14,7 @@ end
|
||||||
function syntax.get(filename)
|
function syntax.get(filename)
|
||||||
for i = #syntax.items, 1, -1 do
|
for i = #syntax.items, 1, -1 do
|
||||||
local t = syntax.items[i]
|
local t = syntax.items[i]
|
||||||
if common.matches_pattern(filename, t.files) then
|
if common.match_pattern(filename, t.files) then
|
||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue