Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(buffers): select_current not selecting current buffer index #3147

Merged
merged 1 commit into from
Jun 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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