Closed Yan-weihao closed 2 years ago
I've improved the warning message, let me know if it is still unclear :smile:
this is the new error
background_colour = "Normal", What value should I set this to?
I've improved the warning message, let me know if it is still unclear :smile:
How do I set up a highlight group with a background
You need to provide a colour to be used for when a window is fully transparent. True transparency is not possible in a terminal so it's faked by setting the window/text to the background colour. Whatever background colour you use for your terminal is a good choice. Looking at your dotfiles I can see you have it set to 0x282A36
so pass #282A36
to the notify setup function
So how can I use nvim-notify in transparent window
The error exists no matter what value I set background_colour to
My notification background is already transparent, but it still warns me
I changed the highlight group
当窗口完全透明时,您需要提供一种颜色。真正的透明度在终端中是不可能的,因此它是通过将窗口/文本设置为背景颜色来伪造的。无论您为终端使用什么背景颜色都是不错的选择。查看您的点文件,我可以看到您已将其设置为
0x282A36
传递给通知设置功能#282A36
how should i use my own highlight group or what color should i give it
As stated in the warning, provide a colour to the setup
require("notify").setup({
background_colour = "#282A36"
})
it doesn't seem to take effect
如警告中所述,为设置提供颜色
require("notify").setup({ background_colour = "#282A36" })
~Can you show me exactly what you're providing to the setup?~ I can see in the screenshot, are you calling setup twice?
this is my config file
`local status_ok, notify = pcall(require, "notify") if not status_ok then vim.notify("notify module not found!") return end
require("notify")("严伟浩欢迎你") vim.notify = notify require("notify").setup({ active = true, on_config_done = nil, -- Animation style (see below for details) stages = "slide", -- Function called when a new window is opened, use for changing win settings/config on_open = nil, -- Function called when a window is closed on_close = nil, -- Render function for notifications. See notify-render() render = "default", -- Default timeout for notifications timeout = 1000, -- Max number of columns for messages max_width = nil, -- Max number of lines for a message max_height = nil, -- For stages that change opacity this is treated as the highlight behind the window -- Set this to either a highlight group, an RGB hex value e.g. "#000000" or a function returning an RGB code for dynamic values background_colour ="#282A36", -- Minimum width for notification windows minimum_width = 50, -- Icons for the different levels icons = { ERROR = "", WARN = "", INFO = "", DEBUG = "", TRACE = "✎", }, }) `
This line require("notify")("严伟浩欢迎你")
you're sending a notification before setup so the default config is used and triggers the warning. Remove that line
此行
require("notify")("严伟浩欢迎你")
您在设置之前发送通知,因此使用默认配置并触发警告。删除该行
thank you, i solved the problem,
I try to use transparent window but it gives warning