Skip to content

Commit

Permalink
fix(buffers): select_current not selecting current buffer index (#3147)
Browse files Browse the repository at this point in the history
Co-authored-by: Yeri <[email protected]>
  • Loading branch information
pirey and Yeri committed Jun 9, 2024
1 parent 3a74349 commit 7231b52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/telescope/builtin/__internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7231b52

Please sign in to comment.