rcarriga / nvim-notify

A fancy, configurable, notification manager for NeoVim
MIT License
3.09k stars 83 forks source link

An warning notification beyond expected when colorscheme was set to transparent background #69

Closed zhang-stephen closed 2 years ago

zhang-stephen commented 2 years ago

As this screenshot, nvim-notify will give a warning if following conditions were satisfied:

And it will repeat this warning hundreds of times, and create many highlight groups, looks like the second screenshot.

image

image

How to reproduce this issue:

environment:

minimal configuration:

vim.api.nvim_command [[set termguicolors]]
vim.api.nvim_command [[packadd packer.nvim]]

local packer = require('packer')
local use = packer.use

return packer.startup(function()
    use { 'wbthomason/packer.nvim', opt = true }

    -- loading colorscheme with transparent backgroud
    use {
        'folke/tokyonight.nvim',
        opt = false,
        config = function()
            vim.g.tokyonight_italic_keywords = false
            vim.g.tokyonight_italic_comments = false
            vim.g.tokyonight_transparent = true
            vim.g.tokyonight_transparent_sidebar = true
            vim.g.tokyonight_style = 'storm'

            vim.api.nvim_command([[colorscheme tokyonight]])
        end
    }

    -- loading nvim-notify
    use {
        'rcarriga/nvim-notify',
        opt = false,
        config = function()
            local notify = require('notify')
            notify.setup {
                stages = 'fade_in_slide_out',
            }

            vim.notify = notify
        end,
    }
end)

Then:

  1. save this configuration, and install packer.nvim if you haven't installed it,
  2. run nvim -u init.lua +PackerSync to make configuration avaliable,
  3. restart the nvim, then run :lua vim.notify('something here'), you could get what shows in screenshots.

And other stages, or non-transparent background would not reproduce this issue in my test.

Ynoop commented 2 years ago

the same problem too。

rcarriga commented 2 years ago

Added a fix to stop the spam but to prevent the warning you must set the background_colour config value to a colour.

zhang-stephen commented 2 years ago

Added a fix to stop the spam but to prevent the warning you must set the background_colour config value to a colour.

~I think giving a default value or an option of backgroud color is more proper, what's your opinion about it?~

the background_color was ignored by me, I will take a try and thanks