mirror of
https://github.com/nvim-telescope/telescope.nvim
synced 2024-09-16 21:24:02 +02:00
fix(builtin.buffers): better buffer in cwd check
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.
This commit is contained in:
parent
c621f71012
commit
5d78b7e1e6
1 changed files with 2 additions and 1 deletions
|
@ -886,7 +886,8 @@ internal.buffers = function(opts)
|
|||
if cwd:sub(-1) ~= Path.path.sep then
|
||||
cwd = cwd .. Path.path.sep
|
||||
end
|
||||
return vim.api.nvim_buf_get_name(bufnr):find(cwd) == nil
|
||||
local bufname_prefix = vim.api.nvim_buf_get_name(bufnr):sub(1, #cwd)
|
||||
return bufname_prefix ~= cwd
|
||||
end
|
||||
|
||||
local bufnrs = vim.tbl_filter(function(bufnr)
|
||||
|
|
Loading…
Reference in a new issue