zen-mode.nvim icon indicating copy to clipboard operation
zen-mode.nvim copied to clipboard

bug: window.backdrop option is ignored

Open hneutr opened this issue 1 year ago • 1 comments

Did you check docs and existing issues?

  • [X] I have read all the zen-mode.nvim docs
  • [X] I have searched the existing issues of zen-mode.nvim
  • [X] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.4

Operating system/version

MacOS 14.2.1

Describe the bug

When commit c1dea35 added default to the highlight command that sets the background color (here), it caused the window.backdrop parameter to be ignored, as zen-mode.setup is called first without a user config, which sets the default highlight, meaning that when the user calls setup, the highlight group has already been defined, and the value for window.backdrop is ignored.

Steps To Reproduce

  1. :lua require("zen-mode").setup({window = {backdrop = 1}})
  2. :ZenMode

Expected Behavior

the window backdrop should respect the configuration file

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/zen-mode.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

hneutr avatar Jan 23 '24 23:01 hneutr

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.

github-actions[bot] avatar Jul 06 '24 01:07 github-actions[bot]

I still getting this issue, plugin version is v1.4.0, packer.lua:

use { "folke/zen-mode.nvim", tag = "v1.4.0" }

CleanShot 2024-08-02 at 16 59 43@2x

tymbaca avatar Aug 02 '24 15:08 tymbaca

@tymbaca Not sure if you're seeing the same thing I'm seeing, but at least in my case, the problem was my EndOfBuffer coloring was showing in the backdrop. I adjusted my colorscheme to avoid the issue, but I also sent a proposed fix here:

  • https://github.com/folke/zen-mode.nvim/pull/156

wincent avatar Nov 09 '24 22:11 wincent