`vim.fn.matchstrpos({expr}, {pat})` doesn't handle all characters well
since the pattern (cwd path in this case) is used as a regex pattern.
(cherry picked from commit b3ff5f3320)
Previously, using `string.find`, certain characters were taken as regex
special characters leading to bad matches.
New approach takes bufname truncated to the length of cwd and compares
the two strings.
(cherry picked from commit 8b56e9bb2d)
closes#2843
Previously, bad partial matches between cwd and target buffer path would
result in non-cwd buffers showing up in the picker despite using
`only_cwd=true`.
eg.
cwd = `/foo/bar`
target buffer = `foo/bar1/baz.txt`
The target buffer starts with the cwd path.
This is fixed by appending a path separator before comparing/matching:
eg.
cwd = `/foo/bar/`
target buffer = `foo/bar1/baz.txt`
(cherry picked from commit c621f71012)
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.
(cherry picked from commit 74be3c3bba)
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.
(cherry picked from commit d5f6c0911d)