mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2025-12-30 21:31:48 +00:00
parent
237ece9bfb
commit
ffa2027102
@ -169,16 +169,16 @@ local frecency = function(opts)
|
||||
}
|
||||
end
|
||||
|
||||
local delim = opts.filter_delimiter or ":"
|
||||
local filter_re = "^(" .. delim .. "(%S+)" .. delim .. ")"
|
||||
|
||||
state.picker = pickers.new(opts, {
|
||||
prompt_title = "Frecency",
|
||||
on_input_filter_cb = function(query_text)
|
||||
local delim = opts.filter_delimiter or ":"
|
||||
-- check for :filter: in query text
|
||||
local new_filter = query_text:gmatch(delim .. "%S+" .. delim)()
|
||||
|
||||
if new_filter then
|
||||
query_text = query_text:gsub(new_filter, "")
|
||||
new_filter = new_filter:gsub(delim, "")
|
||||
local matched, new_filter = query_text:match(filter_re)
|
||||
if matched then
|
||||
query_text = query_text:sub(matched:len() + 1)
|
||||
end
|
||||
|
||||
local new_finder
|
||||
|
||||
Loading…
Reference in New Issue
Block a user