onedark.nvim
onedark.nvim copied to clipboard
nvim-cmp window with transparency is not fully opaque
When Using nvim-cmp and onedark with transparency the nvim-cmp window is not fully opaque
But When using the Catppuccin Colorscheme the nvim-cmp Window is fully opaque
Hardware
Operating System - Windows 11 24H2 Terminal Emulator - Windows Terminal Version 1.21.3231.0 Neovim Version - 0.10.2
@Kulwinderpal Sorry for thedelayed response—I'm currently looking into the issue
require('cmp').setup({
window = {
completion = {
border = 'rounded',
winhighlight = "Normal:Normal,FloatBorder:Normal"
},
documentation = {
border = 'rounded',
winhighlight = "Normal:Normal,FloatBorder:Normal"
},
},
})
Add this to your config
@Kulwinderpal Sorry for thedelayed response—I'm currently looking into the issue
If you haven’t identified the bug yet, I’d be happy to fix it and open a pull request. I’ll begin investigating as soon as you give me the okay. I have never contributed to open source and this would be a great opportunity.
This is a configuration issue with nvim-cmp's window highlighting. The theme provides proper NormalFloat and Pmenu highlights, but cmp's default winhighlight settings can override them.
Solution (as mentioned by @deanqx in the comments):
Add this to your cmp configuration:
require('cmp').setup({
window = {
completion = {
border = 'rounded',
winhighlight = "Normal:Normal,FloatBorder:Normal"
},
documentation = {
border = 'rounded',
winhighlight = "Normal:Normal,FloatBorder:Normal"
},
},
})
This tells cmp to use the standard Normal highlight group instead of its own floating window highlights, giving you the opaque background you're expecting.
Alternative - Customize the Pmenu colors if you prefer a different background:
require('onedark').setup({
highlights = {
Pmenu = { fg = "$fg", bg = "$bg1" }, -- Adjust bg color as needed
PmenuSel = { bg = "$bg3" },
}
})
Closing as this is a cmp configuration choice rather than a theme bug. Feel free to reopen if you have issues with the suggested solutions!