When filtering is applied, `picker:get_index(picker:get_selection_row())` returns index relative to the filtered entry list rather than the original full results. This causes inaccurate indexing into the `cache_pickers` table.
macOS 13.x (Ventura, Darwin 22.x) uses `apropos(1)` from FreeBSD, which
does not behave the same as the previous implementation up to macOS 12.
`apropos(1)` takes a regular expression as an argument, so passing "."
causes it to match anything and therefore return all results to be
filtered by Telescope.
* feat(picker): command history filter
I've recently start using command history. For sometime was a bit annoyed of unrelevant commands
like edit/write and others (most likely only used once)
I've considered using lua patterns, however, logical `or` isn't a thing. Additionally, passing a list of lua patterns and checking each pattern for each command history entry felt tedious.
This PR introduce a new optional function to filter command history items.
For example, in my configurations
~~~lua
local command_history_ignore = vim.regex "edit\\|Move\\|write\\|Write\\|e\\s\\|lua\\sI("
overrides.command_history = minimal {
prompt_prefix = "CMDHistory> ",
filter_fn = function(item)
if #item < 3 then
return false
else
return not command_history_ignore:match_str(item)
end
end,
}
~~~
* [docgen] Update doc/telescope.txt
skip-checks: true
Co-authored-by: Github Actions <actions@github>