folke / zen-mode.nvim

🧘 Distraction-free coding for Neovim
Apache License 2.0
1.69k stars 47 forks source link

bug: window.backdrop option is ignored #115

Closed hneutr closed 2 months ago

hneutr commented 8 months ago

Did you check docs and existing issues?

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
github-actions[bot] commented 3 months ago

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.

tymbaca commented 2 months ago

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