fix(picker.matcher): fix cwd_bonus check

This commit is contained in:
Folke Lemaitre 2025-02-02 22:03:52 +01:00
parent 1d99bac9bc
commit 00af290906
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -321,7 +321,9 @@ function M:update(item)
item.frecency = item.frecency or self.frecency:get(item)
score = score + (1 - 1 / (1 + item.frecency)) * BONUS_FRECENCY
end
if self.opts.cwd_bonus and self.cwd == item.cwd or Snacks.picker.util.path(item):find(self.cwd, 1, true) == 1 then
if
self.opts.cwd_bonus and (self.cwd == item.cwd or Snacks.picker.util.path(item):find(self.cwd, 1, true) == 1)
then
score = score + BONUS_CWD
end
end