Closed adoyle-h closed 1 year ago
Thank you for raising. Will look into this during the week. I'll be surprised if this is plugin related as we're mostly using core Vim functionality at load.
Can you reproduce this with a minimal.lua
file? I've just tried with my config and I can't reproduce it:
@olimorris
Notice: When a session saved two or more buffers, cmdheight will be set to 1. If a session saved only 1 buffer, the cmdheight is still be 2.
You should save session with 2 buffers (vsplit
or split
) to reproduce this issue.
The minimal.lua file.
vim.opt.sessionoptions = { 'curdir', 'folds', 'tabpages', 'winpos' }
vim.opt.cmdheight = 2
vim.opt.rtp:prepend('~/.local/share/nvim/plugins/persisted.nvim/')
require('persisted').setup {}
Open neovim with nvim -u ./minimal.lua
.
@tmpm697 can you raise a new issue. This is not related to this
@adoyle-h. Struggling to reproduce this now, I've just tried with the following config and two buffers written into a session.
local root = "/tmp/persisted"
-- Set stdpaths to use root dir
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)
vim.opt.sessionoptions = { 'curdir', 'folds', 'tabpages', 'winpos' }
vim.opt.cmdheight = 2
-- Install plugins
local plugins = {
{
"olimorris/persisted.nvim",
config = true
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
Screenshot below:
Can you try with my config above?
@olimorris You should use :vs
or :sp
to open two buffers in same screen to reproduce this issue.
You don't need plugin manager to install plugin. Just use git clone <dir>
to download plugin. And add the <dir>
to vim.opt.rtp
.
vim.opt.sessionoptions = { 'curdir', 'folds', 'tabpages', 'winpos' }
vim.opt.cmdheight = 2
vim.opt.rtp:prepend('~/.local/share/nvim/plugins/persisted.nvim/') -- git clone directory
require('persisted').setup {}
This my record.
Okay sorry. Long day yesterday. So I can recreate this bug without persisted and using native vim commands:
vim.opt.sessionoptions = { 'curdir', 'folds', 'tabpages', 'winpos' }
vim.opt.cmdheight = 2
Can you test the same and then I propose one of us raises an issue in Neovim core.
Yes. I reproduce it with your codes. Thank you so much. @olimorris
@adoyle-h I've now raised this https://github.com/neovim/neovim/issues/22450
Emmm.... I raised it too. 😅
Haha damn. Who's written the cleaner issue? 🤣🤣🤣
I think mine is better. I test it with { 'options', 'localoptions' }
, and get the same issue.
I set
vim.o.cmdheight=2
in myinit.lua
and thecmdheight
is 2 when enter the nvim. But it will be set to 1 after open session (bySessionLoad
).Before
SessionLoad
,:verb set cmdheight
shows,After
SessionLoad
,:verb set cmdheight
shows,Notice: When a session saved two or more buffers, cmdheight will be set to 1. If a session saved only 1 buffer, the
cmdheight
is still be 2.I have disabled all plugins except persisted.nvim. So I am sure this issue is related with persisted.nvim.
The
cmdheight
won't be set to 1 when open files directly withnvim file
andnvim -o file1 file2
.My environment
nvim version: NVIM v0.8.0 Build type: Release LuaJIT 2.1.0-beta3
persisted.nvim version: commit 587b90b
My persisted.nvim options:
My
sessionoptions
vim option:curdir,folds,tabpages,winpos
Sesssion file
For example, it is the sesssion file which saved two buffers.