From 424771fc1e8f5d76251e7a3b5ecac8f0286c7230 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 10 Jul 2021 12:05:57 +0800 Subject: Make tabs clickable and add close current tab button --- lua/luatab/init.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/luatab/init.lua b/lua/luatab/init.lua index 597af3a..92fa05e 100644 --- a/lua/luatab/init.lua +++ b/lua/luatab/init.lua @@ -64,11 +64,11 @@ local function formatTab(current) local bufnr = buflist[winnr] local hl = (isSelected and '%#TabLineSel#' or '%#TabLine#') - return hl .. ' ' .. + return hl .. '%' .. current .. 'T' .. ' ' .. tabWindowCount(current) .. tabName(bufnr) .. ' ' .. tabModified(bufnr) .. - tabDevicon(bufnr, isSelected) .. + tabDevicon(bufnr, isSelected) .. '%T' .. tabSeparator(current) end @@ -79,7 +79,11 @@ local function tabline() line = line .. formatTab(i) i = i + 1 end - return line .. '%T%#TabLineFill#%=' + line = line .. '%#TabLineFill#%=' + if vim.fn.tabpagenr('$') > 1 then + line = line .. '%#TabLine#%999XX' + end + return line end local M = { -- cgit v1.2.3