mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(picker.matcher): regex offset by one. Fixes #878
This commit is contained in:
parent
392245e627
commit
9a82f0a564
2 changed files with 2 additions and 1 deletions
|
@ -570,7 +570,7 @@ function M:render()
|
|||
if self.matcher.pattern ~= pattern then
|
||||
self.matcher:init(pattern)
|
||||
end
|
||||
local search = vim.trim(self.picker.input.filter.search)
|
||||
local search = Snacks.picker.util.parse(vim.trim(self.picker.input.filter.search))
|
||||
if self.matcher_regex.pattern ~= search then
|
||||
self.matcher_regex:init(search)
|
||||
end
|
||||
|
|
|
@ -438,6 +438,7 @@ function M:regex(str, pattern)
|
|||
end
|
||||
local from, to = re:match_str(str)
|
||||
if from and to then
|
||||
from = from + 1
|
||||
return self.score:get(str, from, to), from, to, str
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue