Closed phootip closed 6 months ago
Are you sure you want to use two session plugins at the same time, namely folke/persistence.nvim
and nvim-possession
? They may have some conflicting behaviour, we would need to look into the code of the former to understand if it interacts with lualine even if not prompted.
I noticed that in your configuration you have lualine twice? This said, I have tried to reproduce it on my side by loading folke/persistence.nvim
as well on top of mine, and I don't see such behaviour of duplicated lualine. I presume this is due to your statusline configurations (also, you're using tabs, does it also happen if loading buffers only normally? I don't exactly know how lualine interacts with tabs, perhaps it duplicates per window?)
For the first question, no, I do not want to use persistence.nvim
together with nvim-possession
, so I specify enabled = false
for persistence.nvim
. You can pay no mind to it, it's a lazyvim
thing (ref),
For second question, that file is an example and do not contribute anything to my nvim because there is a return {}
on line 3.
this file also a part of lazyvim starter repo.
Basically I'm was reproducing this with as least commit as possible branching from lazyvim starter repo
Thank you for answering, another thing is that this double lualine go away after resizing the terminal, I tested it with window terminal and iterm2, but do not go away if I use :redraw
, :redrawtabline
.
Let us try to test it with a minimal configuration: please use the below template as repro.lua
and then execute nvim -u 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",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{ "craftzdog/solarized-osaka.nvim" },
{
"gennaro-tedesco/nvim-possession",
dependencies = {
"ibhagwan/fzf-lua",
},
config = true,
init = function()
local possession = require("nvim-possession")
vim.keymap.set("n", "<leader>sl", function()
possession.list()
end)
vim.keymap.set("n", "<leader>sn", function()
possession.new()
end)
vim.keymap.set("n", "<leader>su", function()
possession.update()
end)
vim.keymap.set("n", "<leader>sd", function()
possession.delete()
end)
end,
},
{ "nvim-lualine/lualine.nvim", config = true },
-- add any other puglins down here
}
vim.g.mapleader = " "
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.opt.termguicolors = true
vim.cmd([[colorscheme solarized-osaka]])
where you can slightly modify the above to adapt it to your configuration options (in particular for lualine
). Modularly add some configuration until you reach the problem and then we can see what is causing it.
Right now I manage to fix this with
vim.api.nvim_create_autocmd("TabEnter", { command = "set cmdheight=1" })
I might try to comeback and reproduce this with minimal config later, thank you for your time
I clone lazyvim starter and then add
possession.lua
toplugins
folder with this configurationbut when I enable![image](https://github.com/gennaro-tedesco/nvim-possession/assets/21254920/36fa3e4f-cf55-4efc-95c0-fce6d01d1adc)
autoload
I got double lualine when changing tabHere are step to reproduce
<leader><Tab><Tab>
)<leader><Tab>[
)This does not happens when I disable autoload and load session normally through require("nvim-possession").list(). You can try this with this repo https://github.com/phootip/lazyvim/tree/test-possession