From d68d1cfde9bf82061dfdfe35b83fb8636e03766d Mon Sep 17 00:00:00 2001 From: bhagwan Date: Wed, 28 Feb 2024 09:07:05 -0800 Subject: [PATCH] chore(tabs): move encoded tab_cwd to start of line (#1064) --- lua/fzf-lua/providers/buffers.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lua/fzf-lua/providers/buffers.lua b/lua/fzf-lua/providers/buffers.lua index 51568e52..7dddacce 100644 --- a/lua/fzf-lua/providers/buffers.lua +++ b/lua/fzf-lua/providers/buffers.lua @@ -3,6 +3,7 @@ local path = require "fzf-lua.path" local utils = require "fzf-lua.utils" local shell = require "fzf-lua.shell" local config = require "fzf-lua.config" +local base64 = require "fzf-lua.lib.base64" local make_entry = require "fzf-lua.make_entry" local M = {} @@ -380,11 +381,12 @@ M.tabs = function(opts) function(s) return s end, utils.ansi_codes[opts.hls.tab_marker]) - local tab_cwd_tilde_base64 = vim.base64 - and vim.base64.encode(tab_cwd_tilde) - or tab_cwd_tilde + local tab_cwd_tilde_base64 = base64.encode(tab_cwd_tilde) if not opts.current_tab_only then - cb(string.format("%d)%s:%s%s\t%s", t, tab_cwd_tilde_base64, utils.nbsp, + cb(string.format("%s:%d)%s%s\t%s", + tab_cwd_tilde_base64, + t, + utils.nbsp, fn_title_hl(title), (t == core.CTX().tabnr) and fn_marker_hl(marker) or "")) end @@ -395,8 +397,8 @@ M.tabs = function(opts) end opts.sort_lastused = false - opts._prefix = string.format("%d)%s:%s%s%s", - t, tab_cwd_tilde_base64, utils.nbsp, utils.nbsp, utils.nbsp) + opts._prefix = string.format("%s:%d)%s%s%s", + tab_cwd_tilde_base64, t, utils.nbsp, utils.nbsp, utils.nbsp) local tabh = vim.api.nvim_list_tabpages()[t] local buffers = populate_buffer_entries(opts, bufnrs_flat, tabh) for _, bufinfo in pairs(buffers) do