noice.nvim
noice.nvim copied to clipboard
issue: window resized in session when open cmdpopup before leave nvim
Did you check docs and existing issues?
- [X] I have read all the noice.nvim docs
- [X] I have searched the existing issues of noice.nvim
- [ ] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
0.9.5
Operating system/version
Linux/Ubuntu (latest) - WSL
Describe the bug
I use persistence.nvim to save and restore session, windows sizes, tabs, buffers, etc. When I use ":qa", session don't save window size, but when I use key map (ctrl+q) to quit all, without open cmdpopup it save windows sizes. When I open cmdpopup and execute some command like ":ls" then I use key map (ctrl+q) to leave, it won't save window sizes. The problem becomes when I use cmdpopup. It only happens with Noice plugin, I can't figure out what lines of code are doing this behavior but I relate this to "mount:popup" class, maybe I'm wrong.
Steps To Reproduce
- Open nvim, press "n" to new file, open any file, e.g. ":e file.txt", then split window or open another file in window
- Resize windows (one bigger than other)
- Execute :qa
- Open nvim again, press "s" to restore session (the windows has equal sizes, not one bigger than other like before you leave)
Expected Behavior
Windows preserve sizes when I leave using cmdpopup
Repro
-- DO NOT change the paths and don't remove the colorscheme
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)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{ "folke/noice.nvim",
opts = {}
},
-- add any other plugins here
{ "nvimdev/dashboard-nvim",
opts = {
theme = "doom",
config = {
center = {
{ action = "ene | startinsert", desc = " New file", icon = " ", key = "n" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
},
},
}
},
{
"folke/persistence.nvim",
event = "BufReadPre",
opts = { options = vim.opt.sessionoptions:get() },
},
{
"MunifTanjim/nui.nvim", lazy = true
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
vim.opt.laststatus = 3
vim.opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" }
vim.keymap.set("n", "<c-q>", "<cmd>qa<cr>", { desc = "Quit all" })
Here is the GIF showing the issue.
However, I could not reproduce the bug with either urzvt
, gnome-terminal
, or alacritty
… :thinking:
I opened MunifTanjim/nui.nvim/issues/370 because if I disable the import of nui
, the issue disappears while noice still works after an initial warning/error.
I am happy to test development branches if that helps.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.