fix(picker.matcher): don't optimize pattern subsets when pattern has a negation

This commit is contained in:
Folke Lemaitre 2025-02-06 08:47:25 +01:00
parent a3bf5bf6ff
commit a6b3d7840b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -179,7 +179,10 @@ function M:init(pattern)
self.tick = self.tick + 1
self.file = nil
self.mods = {}
self.subset = self.pattern ~= "" and pattern:find(self.pattern, 1, true) == 1 and not pattern:find("|", 1, true)
self.subset = self.pattern ~= ""
and pattern:find(self.pattern, 1, true) == 1
and not pattern:find("|", 1, true)
and not pattern:find("!", 1, true)
self.pattern = pattern
self:abort()
self.one = nil