Don't duplicate regex

develop
Robob27 2023-02-08 02:02:50 -05:00
parent 13440d18a8
commit 54560bc5db
1 changed files with 6 additions and 6 deletions

@ -2028,15 +2028,15 @@ function FilteredList:setFilter(filter, pos)
-- punctuation itself to be matched if that is useful (e.g.
-- filenames or parameter names)
if key ~= '' then
if self.case_sensitive and
not search_key:match('%f[^%p\x00]'..key) and
if not self.case_sensitive then
search_key = string.lower(search_key)
key = string.lower(key)
end
if not search_key:match('%f[^%p\x00]'..key) and
not search_key:match('%f[^%s\x00]'..key) then
ok = false
break
elseif not string.lower(search_key):match('%f[^%p\x00]'..string.lower(key)) and
not string.lower(search_key):match('%f[^%s\x00]'..string.lower(key)) then
ok = false
break
end
end
end