拦截一些不影响使用体验的错误信息

This commit is contained in:
tiny 2025-09-04 14:06:43 +00:00
parent 8e6d327b49
commit d9b2d0ca88

View file

@ -1,13 +1,13 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
-- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
"rcarriga/nvim-notify",
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
-- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
"rcarriga/nvim-notify",
},
config = function()
require("noice").setup({
@ -27,8 +27,20 @@ return {
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
-- 在这里添加或修改 routes 配置
routes = {
{
filter = {
event = "msg_show",
kind = "emsg",
-- 使用这个错误信息中稳定且独特的片段作为过滤关键词
find = "Error in decoration provider",
},
-- opts.skip = true 会告诉 Noice 完全忽略这条消息
opts = { skip = true },
},
-- ... 这里可能还有你其他的 routes 规则,或者没有
},
})
end
end,
}