Skip to content

Commit

Permalink
fix(config): allow the user to disable default filters by setting the…
Browse files Browse the repository at this point in the history
…m to false
  • Loading branch information
Sam-programs committed Apr 27, 2024
1 parent 0cbe3f8 commit 5d1224f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions doc/noice.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
2 changes: 1 addition & 1 deletion lua/noice/message/filter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d1224f

Please sign in to comment.