diff --git a/doc/noice.nvim.txt b/doc/noice.nvim.txt index 6d2f23a9..3a4fa5b6 100644 --- a/doc/noice.nvim.txt +++ b/doc/noice.nvim.txt @@ -429,6 +429,21 @@ Example: ~ } < +You can disable a filter by setting it's value to false. +Example: ~ +>lua + require('noice').setup({ + commands = { + history = { + filter = { + -- disable the default "any" filter + any = false, + }, + }, + } + }) +> + VIEWS *noice.nvim-noice-(nice,-noise,-notice)-views* diff --git a/lua/noice/message/filter.lua b/lua/noice/message/filter.lua index b7667684..18fa5a8c 100644 --- a/lua/noice/message/filter.lua +++ b/lua/noice/message/filter.lua @@ -141,7 +141,7 @@ M._unknown_notified = {} function M.is(message, filter) for k, v in pairs(filter) do if M.filters[k] then - if not M.filters[k](message, v) then + if v and not M.filters[k](message, v) then return false end else