mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2025-12-06 06:46:10 +00:00
fix(buffers): select_current not selecting current buffer index (#3147)
Co-authored-by: Yeri <yeri@accelbyte.net>
This commit is contained in:
@@ -933,7 +933,7 @@ internal.buffers = function(opts)
|
||||
|
||||
local buffers = {}
|
||||
local default_selection_idx = 1
|
||||
for _, bufnr in ipairs(bufnrs) do
|
||||
for i, bufnr in ipairs(bufnrs) do
|
||||
local flag = bufnr == vim.fn.bufnr "" and "%" or (bufnr == vim.fn.bufnr "#" and "#" or " ")
|
||||
|
||||
if opts.sort_lastused and not opts.ignore_current_buffer and flag == "#" then
|
||||
@@ -951,7 +951,7 @@ internal.buffers = function(opts)
|
||||
table.insert(buffers, idx, element)
|
||||
else
|
||||
if opts.select_current and flag == "%" then
|
||||
default_selection_idx = bufnr
|
||||
default_selection_idx = i
|
||||
end
|
||||
table.insert(buffers, element)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user