From ccfceebe9824110628144123ab7d01ded0db5668 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 4 May 2024 21:38:21 +0800 Subject: [PATCH] perf(tabline): add sep after hide left section --- lua/spacevim/plugin/tabline.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/spacevim/plugin/tabline.lua b/lua/spacevim/plugin/tabline.lua index fba3afa39..f336e14e8 100644 --- a/lua/spacevim/plugin/tabline.lua +++ b/lua/spacevim/plugin/tabline.lua @@ -152,7 +152,9 @@ local function tabline_sep(a, b) local hi_a local hi_b - if vim.api.nvim_buf_get_option(a.bufnr, 'modified') then + if not a then + hi_a = 'SpaceVim_tabline_b' + elseif vim.api.nvim_buf_get_option(a.bufnr, 'modified') then hi_a = 'SpaceVim_tabline_m' elseif a.bufnr == vim.api.nvim_get_current_buf() then hi_a = 'SpaceVim_tabline_a' @@ -444,7 +446,9 @@ function M.get() shown_items = get_show_items() local preview_item if #left_hide_bufs > 0 and vim.fn.tabpagenr('$') == 1 then - tablinestr = '%#SpaceVim_tabline_b# << ' .. #left_hide_bufs .. ' ' + tablinestr = '%#SpaceVim_tabline_b# << ' + .. #left_hide_bufs .. ' ' + .. tabline_sep(preview_item, shown_items[1]) end for _, item in ipairs(shown_items) do if preview_item then