From 3424af03a832dcbbd722cfb13b5b3b69a9858c17 Mon Sep 17 00:00:00 2001 From: James Trew <66286082+jamestrew@users.noreply.github.com> Date: Fri, 13 Sep 2024 00:29:07 +0000 Subject: [PATCH] Revert "fix(buffers): bad `sort_lastused` result selection (#3289)" This reverts commit 1398e11b06f67276881ed44dcefda5050d8ecd0c. --- lua/telescope/builtin/__internal.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/telescope/builtin/__internal.lua b/lua/telescope/builtin/__internal.lua index 958a4743db..d7d74e7c8f 100644 --- a/lua/telescope/builtin/__internal.lua +++ b/lua/telescope/builtin/__internal.lua @@ -938,6 +938,10 @@ internal.buffers = function(opts) 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 + default_selection_idx = 2 + end + local element = { bufnr = bufnr, flag = flag,