You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues of zen-mode.nvim
I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
NVIM v0.10.0-dev-664+g0ce391086
Operating system/version
MacOS 13.4
Describe the bug
Switching buffers while in ZenMode doesn't apply zen-mode options.
There is also this strange issue where ZenMode does apply zen-mode options when switching to certain buffers, but the original options for those buffers are not restored upon exiting ZenMode, though I haven't been able to trace the root cause as it is rather inconsistent. (I think it may be lsp-related, as it only happens on buffers that lsps like lua_ls and tsserver attach to, but I'm not entirely sure).
As you can see from the example, ZenMode options are applied to all buffers except the one with 2.lua opened, which is the only one that has its original line number column restored upon exiting ZenMode.
Steps To Reproduce
Toggle ZenMode
Open new buffers
ZenMode options are not applied to new buffers
Expected Behavior
I would expect that ZenMode options are applied when switching between buffers while ZenMode is enabled, and that the original buffer options (signcolumn, line numbers, etc.) are properly restored disabling ZenMode.
Repro
-- DO NOT change the paths and don't remove the colorschemelocalroot=vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .reprofor_, nameinipairs({ "config", "data", "state", "cache" }) dovim.env[("XDG_%s_HOME"):format(name:upper())] =root.."/" ..nameend-- bootstrap lazylocallazypath=root.."/plugins/lazy.nvim"ifnotvim.loop.fs_stat(lazypath) thenvim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
endvim.opt.runtimepath:prepend(lazypath)
vim.keymap.set("n", "H", "<cmd>bprev<cr>")
vim.keymap.set("n", "L", "<cmd>bnext<cr>")
vim.opt.number=truevim.opt.relativenumber=truevim.opt.foldcolumn="2"vim.opt.signcolumn="yes"-- install pluginslocalplugins= {
"folke/tokyonight.nvim",
{
"folke/zen-mode.nvim",
cmd="ZenMode",
opts= {
window= {
backdrop=1,
width=function()
returnmath.min(120, vim.o.columns*0.75)
end,
height=0.9,
options= {
number=false,
relativenumber=false,
foldcolumn="0",
list=false,
showbreak="NONE",
signcolumn="no",
},
},
plugins= {
options= {
cmdheight=1,
laststatus=0,
},
},
},
},
-- add any other plugins here
}
require("lazy").setup(plugins, {
root=root.."/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
The text was updated successfully, but these errors were encountered:
Subjective
changed the title
bug: Switching buffers while in ZenMode doesn't apply zen-mode options
bug: Switching buffers while in ZenMode doesn't apply ZenMode options
Jul 14, 2023
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.0-dev-664+g0ce391086
Operating system/version
MacOS 13.4
Describe the bug
Switching buffers while in ZenMode doesn't apply zen-mode options.
There is also this strange issue where ZenMode does apply zen-mode options when switching to certain buffers, but the original options for those buffers are not restored upon exiting ZenMode, though I haven't been able to trace the root cause as it is rather inconsistent. (I think it may be lsp-related, as it only happens on buffers that lsps like lua_ls and tsserver attach to, but I'm not entirely sure).
As you can see from the example, ZenMode options are applied to all buffers except the one with
2.lua
opened, which is the only one that has its original line number column restored upon exiting ZenMode.Steps To Reproduce
Expected Behavior
I would expect that ZenMode options are applied when switching between buffers while ZenMode is enabled, and that the original buffer options (signcolumn, line numbers, etc.) are properly restored disabling ZenMode.
Repro
The text was updated successfully, but these errors were encountered: