Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Tabs component incorrect padding/whitespace #58

Open
EmreDogann opened this issue Jun 24, 2023 · 0 comments
Open

Tabs component incorrect padding/whitespace #58

EmreDogann opened this issue Jun 24, 2023 · 0 comments

Comments

@EmreDogann
Copy link

When using the tabs component in lualine.nvim like so:

lualine_x = {
	{
		_G.Statusline_Getcwd,
		icons_enabled = true,
		icon = "",
	},
	{
		require("nvim-possession").status,
		cond = function()
			return require("nvim-possession").status() ~= nil
		end,
	},
	{
		require("tabline").tabline_tabs,
		padding = {
			left = 1,
			right = 0,
		},
	},
},

There is an issue where other lualine components configured to render before tabline's tab component leads to incorrect whitespace:

image

There should not be any padding/whitespace between 📌 tabline-plugin | and the tab component on the far right. Below is what it is supposed to look like:

image

This was done by changing M.format_tabs() to remove the %= separation status item:

function M.format_tabs(tabs, max_length)
	
	...
	
	M.total_tab_length = total_length
	if M.options.show_tabs_always then
		line = "%#TabLineFill#%999X" .. line			<--- Removed %= from the start
	elseif #tabs == 1 and tabs[1].name ~= "1 " then
		line = "%#TabLineFill#%999X" .. line			<--- Removed %= from the start
	elseif #tabs > 1 then
		line = "%#TabLineFill#%999X" .. line			<--- Removed %= from the start
	else
		line = "%#TabLineFill#%999X"					<--- Removed %= from the start
		M.total_tab_length = 0
	end
	
	return line
end
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant