Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed tabout clears the statusline #70

Closed
smartinellimarco opened this issue Jul 16, 2024 · 3 comments
Closed

Failed tabout clears the statusline #70

smartinellimarco opened this issue Jul 16, 2024 · 3 comments

Comments

@smartinellimarco
Copy link

When attempting to do a tabout (and failing), for some reason the statusline (lualine) disappears.

@abecodes
Copy link
Owner

Hi @smartinellimarco,

do you have a codesnippet? I use lualine myself and never encountered this oO

@smartinellimarco
Copy link
Author

smartinellimarco commented Jul 20, 2024

Here is a minimal example (note the cmdheight=0 setting):
run with: nvim -u repro.lua repro.lua

repro.lua

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
vim.opt.cmdheight = 0

-- install plugins
local plugins = {
	{
		"nvim-lualine/lualine.nvim",
		opts = {
			options = {
				globalstatus = true,
				component_separators = "",
				section_separators = "",
			},
			sections = {
				lualine_a = { "mode" },
				lualine_b = { { "filename", path = 1 } },
				lualine_c = { "branch", "diagnostics" },
				lualine_x = { "encoding" },
				lualine_y = { "progress" },
				lualine_z = { "location" },
			},
		},
	},
	{
		"abecodes/tabout.nvim",
		opts = {
			act_as_tab = false,
			act_as_shift_tab = false,
			enable_backwards = true,
			completion = false,
			tabouts = {
				{ open = "'", close = "'" },
				{ open = '"', close = '"' },
				{ open = "`", close = "`" },
				{ open = "(", close = ")" },
				{ open = "[", close = "]" },
				{ open = "{", close = "}" },
			},
			exclude = {},
		},
	},
}

require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

@abecodes
Copy link
Owner

I do not have/use lazy, but if I run this file with vim.opt.cmdheight = 0 and do the <S-TAB> in an indentation area the lualine disappears until the next keypress. Is this the behavior you are experiencing?

This does not happen with vim.opt.cmdheight = 2. After googling a little looks like there are some issues with nvim, statuslines in general and vim.opt.cmdheight = 0, eg here or here and something similar.

I get the feeling that vim.opt.cmdheight = 0 is an either or thing and this is nothing we can fix in tabout.
So I guess it is either vim.opt.cmdheight = 1/2 or no/flickering statusline 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants