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

fix(zen-mode-nvim): disable global winbar upon entering zen mode #554

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lua/astrocommunity/editing-support/zen-mode-nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ return {
vim.g.miniindentscope_disable_old = vim.g.miniindentscope_disable
vim.g.miniindentscope_disable = true

vim.g.winbar_old = vim.wo.winbar
vim.api.nvim_create_autocmd({ "BufWritePost", "BufWinEnter", "BufNew" }, {
vim.g.winbar_old = vim.o.winbar
vim.api.nvim_create_autocmd({ "BufWinEnter", "BufNew" }, {
pattern = "*",
callback = function() vim.wo.winbar = nil end,
callback = function() vim.o.winbar = nil end,
group = vim.api.nvim_create_augroup("disable_winbar", { clear = true }),
desc = "Ensure winbar stays disabled when writing to file, switching buffers, opening floating windows, etc.",
})
Expand All @@ -57,7 +57,7 @@ return {
if vim.g.indent_blankline_enabled_old then vim.cmd "IndentBlanklineRefresh" end

vim.api.nvim_clear_autocmds { group = "disable_winbar" }
vim.wo.winbar = vim.g.winbar_old
vim.o.winbar = vim.g.winbar_old

if utils.is_available "vim-matchup" then
vim.g.matchup_matchparen_offscreen = vim.g.matchup_matchparen_offscreen_old
Expand Down