rcarriga / nvim-notify

A fancy, configurable, notification manager for NeoVim
MIT License
2.97k stars 78 forks source link

Cannot remove search highlights in notifications #170

Open runiq opened 1 year ago

runiq commented 1 year ago

I was trying to get rich of the search highlights in my notifications. For example, when searching for foo: Screenshot_20230127_142648

I tried it this way:

-- Create a new namespace
local no_search_hl = vim.api.nvim_create_namespace("no_search_hl")

-- Remove search highlighting in that namespace
vim.api.nvim_set_hl(no_search_hl, "Search", { bg = "none" })

-- Use this namespace for nvim-notify's windows
require("notify").setup({
  on_open = function(win)
    vim.api.nvim_win_set_hl_ns(win, no_search_hl)
  end,
})

However, I must be doing something wrong, since the highlights are still there. Any pointers as to what I could do to disable them? :(

NGPONG commented 1 month ago

I've encountered the same issue. When I use the same method as OP, I get some weird highlighting behavior. It would be wonderful if there's a fix for this!