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

bug: Buffers don't open with transparent background using transparent.nvim(when there is a filter rule?) #15

Closed
3 tasks done
Ciel-MC opened this issue Jun 7, 2023 · 5 comments · Fixed by #17
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@Ciel-MC
Copy link

Ciel-MC commented Jun 7, 2023

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.10.0-dev-422+g68e2d7229

Operating system/version

Linux6.3.5-arch1-1

Describe the bug

Whenever opening a buffer(e.g. neotree and spectre), the background does not turn transparent, but instead uses the theme's background.

Which goes transparent if I move away from the buffer and move back.

Notably, using the repro config, the filter has to be there for it to happen.

Steps To Reproduce

  1. Enable transparency with transparent.nvim
  2. Open neotree with :Neotree toggle
  3. Panel isn't transparent

Expected Behavior

The buffer opens with transparent background

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",

  "nvim-lua/plenary.nvim",
  "MunifTanjim/nui.nvim",
  "nvim-neo-tree/neo-tree.nvim",

  {
    "folke/edgy.nvim",
    opts = {
      left = {
        {
          -- title = "Neo-Tree",
          ft = "neo-tree",
          filter = function(buf)
            return vim.b[buf].neo_tree_source == "filesystem"
          end,
        }
      }
    }
  },
  {
    "xiyaowong/transparent.nvim",
    opts = {
      extra_groups = {
        "NeoTreeNormal",
        "NeoTreeNormalNC",
      }
    }
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-
@Ciel-MC Ciel-MC added the bug Something isn't working label Jun 7, 2023
@folke folke closed this as completed in 779fdd8 Jun 8, 2023
@folke
Copy link
Owner

folke commented Jun 8, 2023

You can set config.wo.winhighlight = "". This will prevent edgy from adding any window highlights.

@Ciel-MC
Copy link
Author

Ciel-MC commented Jun 8, 2023

I have just updated and tried it out, it's still a bit weird though in that the background doesn't change until you move out of the window if your cursor was focused onto the window, or move in if it's not. Did I do something wrong?

@folke
Copy link
Owner

folke commented Jun 8, 2023

Did you set

    opts = {
      wo = {
        winhighlight = "",
      },
...

@folke
Copy link
Owner

folke commented Jun 8, 2023

I also just pushed a change to better deal with winhl, but it shouldn't really matter in your case I think.

@Ciel-MC
Copy link
Author

Ciel-MC commented Jun 8, 2023

Did you set

    opts = {
      wo = {
        winhighlight = "",
      },
...

I didn't. Though now that I did, it seems to be working fine. I don't really get what's going on, but it's great that it works now, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants