rcarriga / nvim-notify

A fancy, configurable, notification manager for NeoVim
MIT License
3k stars 80 forks source link

animation style "fade" and "fade_in_slide_out" problem #122

Closed snowy-shadow closed 2 years ago

snowy-shadow commented 2 years ago

Hi, I keep getting the warning along the lines of "opacity changes require termguicolor to be set, set termguicolor or change the animation style" every time i launch nvim. I copied over the default config as provided in the readme, but changed the animation style to "fade". All of the other animations worked great without giving me the error except for "fade" and "fade_in_slide_out". I'm using wezterm and have set termguicolor = true. I'm not sure if I'm missing anything? Also if you don't mind whats your color theme? it looks great. Also great plugin!

MacOS w Zsh nvim = 0.7.2

  {
    background_colour = "Normal",
    fps = 30,
    icons = {
      DEBUG = "",
      ERROR = "",
      INFO = "",
      TRACE = "✎",
      WARN = ""
    },
    level = 2,
    minimum_width = 50,
    render = "default",
    stages = "fade_in_slide_out", <- fade gives me warning
    timeout = 5000
  }
rcarriga commented 2 years ago

The code for checking if termuicolors is set is very simple (https://github.com/rcarriga/nvim-notify/blob/master/lua/notify/config/init.lua#L171) so I'm not sure how it could be going wrong.

Are you sure termguicolors is set correctly? How are you setting it?

rcarriga commented 2 years ago

Also my colour scheme is my own https://github.com/rcarriga/dotfiles/blob/master/.config/nvim/lua/colors.lua :smile:

snowy-shadow commented 2 years ago

very sorry for the late reply! I am setting it using vim.opt and wezterm comes with true color support by default i believe. Looking at the termguicolor check it might be i just couldn't set it up properly 😅. Also thank you for the colors!

UPDATE, I found the reason, one of my plugins (i don't know which) was messing my the termguicolor setting, loading termguicolors = true before all of the other plugins fixed it

gennaro-tedesco commented 2 years ago

Interestingly enough I still see this exception when setting up notify default options: namely

require("notify").setup({
    stages = "fade_in_slide_out"
})

returns the aforementioned exception; however, if I explicitly pass stages = "fade_in_slide_out" to a notify call, the error disappears.

I am on

Kernel:     Darwin 21.6.0
OS:         macOS 12.5.1 Monterey
Shell:      /bin/zsh

if needed.

rcarriga commented 1 year ago

however, if I explicitly pass stages = "fade_in_slide_out" to a notify call, the error disappears.

I'm not sure what you mean by this, there is no stages argument for a notification.

Please verify that :echo &termguicolors prints 1 after seeing the warning and if so open a separate issue. I won't be able to track closed issues

gennaro-tedesco commented 1 year ago

however, if I explicitly pass stages = "fade_in_slide_out" to a notify call, the error disappears.

I'm not sure what you mean by this, there is no stages argument for a notification.

Isn't this the stages argument? It is also referenced in the README and it does accept values when passed (such values indeed overriding the defaults).

rcarriga commented 1 year ago

Yes that's for the setup function, you said you passed it to a notify call i.e. require("notify")(...). Again please open a separate issue, I won't be tracking this

gennaro-tedesco commented 1 year ago

Yes that's for the setup function, you said you passed it to a notify call i.e. require("notify")(...).

Yes, that's my point, you can pass the option to a notify call directly, and that works by overriding the defaults: I thought I would provide this bit of info that can be useful for you if you want to further debug it :).

I will be opening a separate issue and prepare a minimally reproducible example.