diff options
author | Alvaro Sevilla <alvarosevilla95@gmail.com> | 2021-07-13 19:55:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-13 19:55:19 +0200 |
commit | cf6d3fcb657a13dac98b6118df56ae4f28e79a92 (patch) | |
tree | cc70ab3ee73fdbab6d49136f16cec5ff27ae9c10 /lua | |
parent | fe379762460d0b0e24dddafbc9cd93752544a06d (diff) | |
parent | 424771fc1e8f5d76251e7a3b5ecac8f0286c7230 (diff) | |
download | minitab.nvim-cf6d3fcb657a13dac98b6118df56ae4f28e79a92.tar.xz minitab.nvim-cf6d3fcb657a13dac98b6118df56ae4f28e79a92.zip |
Merge pull request #2 from zeertzjq/clickable
Make tabs clickable and add close current tab button
Diffstat (limited to 'lua')
-rw-r--r-- | lua/luatab/init.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lua/luatab/init.lua b/lua/luatab/init.lua index 5e419c2..9533564 100644 --- a/lua/luatab/init.lua +++ b/lua/luatab/init.lua @@ -65,11 +65,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 @@ -80,7 +80,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 = { |