fix: refacto path matchings throughout the code, change the way we call string methods

This commit is contained in:
kiyan42
2020-04-25 15:11:14 +02:00
parent 7fbcfa531c
commit 60adbfbdf3
6 changed files with 25 additions and 24 deletions

View File

@@ -25,7 +25,7 @@ end
local function create_matcher(arr)
return function(name)
for _, n in pairs(arr) do
if string.match(name, n) then return true end
if name:match(n) then return true end
end
return false
end
@@ -142,7 +142,7 @@ local function highlight_line(buffer)
elseif config.SHOW_FILE_ICON then
for k, v in pairs(HIGHLIGHT_ICON_GROUPS) do
if string.match(node.name, k) ~= nil then
if node.name:match(k) ~= nil then
text_start = text_start + 4
highlight('LuaTree' .. v, line, 0, text_start)
break