Skip to content

Commit b5f4ad1

Browse files
committed
Add support to anoint sorting
1 parent e211ff8 commit b5f4ad1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Classes/NotableDBControl.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,21 @@ function NotableDBClass:DoesNotableMatchFilters(node)
5252
return false
5353
end
5454

55-
local searchStr = self.controls.search.buf:lower()
55+
local searchStr = self.controls.search.buf:lower():gsub("[%-%.%+%[%]%$%^%%%?%*]", "%%%0")
5656
if searchStr:match("%S") then
5757
local found = false
5858
local mode = self.controls.searchMode.selIndex
5959
if mode == 1 or mode == 2 then
60-
if node.dn:lower():find(searchStr, 1, true) then
60+
local err, match = PCall(string.matchOrPattern, node.dn:lower(), searchStr)
61+
if not err and match then
6162
found = true
6263
end
6364
end
6465
if mode == 1 or mode == 3 then
6566
for _, line in ipairs(node.sd) do
66-
if line:lower():find(searchStr, 1, true) then
67+
local err, match = PCall(string.matchOrPattern, line:lower(), searchStr)
68+
if not err and match then
6769
found = true
68-
break
6970
end
7071
end
7172
end

0 commit comments

Comments
 (0)