rcarriga / nvim-notify

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

[Bug] Border highlight does not appear correctly in first stages of notification animation #123

Closed akinsho closed 2 years ago

akinsho commented 2 years ago

I've noticed since the merge of highlight namespaces in neovim nightly that nvim-notify notifications now seem to be missing their border highlight when they first appear. When the notification starts to transition out, then the border highlight is visible, but initially there is none.

I noted that you raised an issue about nvim_set_hl(0, ... not calling redraw, which was recently closed, and I wonder if this might be related.

Please note the specific theme is probably irrelevant, I just added it, so I had something sensible to look at rather than the default theme

Screen Shot 2022-08-19 at 08 56 32
vim.cmd.packadd("nvim-notify")
vim.cmd.packadd("doom-one.nvim")

local api = vim.api
vim.opt.termguicolors = true
vim.cmd.colorscheme('doom-one')

api.nvim_set_hl(0, "NotifyERRORBorder", { bg = "#181a21", fg = "#4b4c53" })
api.nvim_set_hl(0, "NotifyWARNBorder", { bg = "#181a21", fg = "#4b4c53" })
api.nvim_set_hl(0, "NotifyINFOBorder", { bg = "#181a21", fg = "#4b4c53" })
api.nvim_set_hl(0, "NotifyDEBUGBorder", { bg = "#181a21", fg = "#4b4c53" })
api.nvim_set_hl(0, "NotifyTRACEBorder", { bg = "#181a21", fg = "#4b4c53" })
api.nvim_set_hl(0, "NotifyERRORBody", { link = "NormalFloat" })
api.nvim_set_hl(0, "NotifyWARNBody", { link = "NormalFloat" })
api.nvim_set_hl(0, "NotifyINFOBody", { link = "NormalFloat" })
api.nvim_set_hl(0, "NotifyDEBUGBody", { link = "NormalFloat" })
api.nvim_set_hl(0, "NotifyTRACEBody", { link = "NormalFloat" })

local notify = require("notify")
notify.setup({
    timeout = 3000,
    stages = "fade_in_slide_out",
    background_colour = "NormalFloat",
})
vim.notify = notify

Run :lua vim.notify('testing', 'error')

Version

NVIM v0.8.0-dev-2340-g700a6fb9d                                                                                                                                                                 
Build type: Release                                                                                                                                                                             
LuaJIT 2.1.0-beta3                                                                                                                                                                              
Compiled by akin@Akins-MacBook-Pro.local                                                                                                                                                        

Features: +acl +iconv +tui                                                                                                                                                                      
See ":help feature-compile"                                                                                                                                                                     

   system vimrc file: "$VIM/sysinit.vim"                                                                                                                                                        
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-700a6fb_1/share/nvim"                                                                                                                   

Run :checkhealth for more info
levouh commented 2 years ago

+1, I have the same issue

NVIM v0.8.0-dev-877-g35653e6bc

There were some reworks in HEAD recently to stuff related to windows & window highlighting, etc. that might be related.

Johan-Palacios commented 2 years ago

I have the same issue NVIM v0.8.0-dev

rcarriga commented 2 years ago

This was due to https://github.com/neovim/neovim/pull/13457

The latest master should be working now :smile:

akinsho commented 2 years ago

Seems to be fixed now @rcarriga thanks 👍🏿