MunifTanjim / nui.nvim

UI Component Library for Neovim.
MIT License
1.62k stars 57 forks source link

[Question] It seems that the floating window doesn't take `blend=80` argument into account. #223

Closed nyngwang closed 1 year ago

nyngwang commented 1 year ago

Hi, I'm a user of noice.nvim. If this cannot be solved from nui.nvim side then I will report this there. This is my settings:

vim.cmd([[
  hi NoiceCmdlinePopup guibg=#101010 blend=30
  hi NoiceCmdlineItems guibg=#101010 blend=80
]])
local wininfo = vim.fn.getwininfo()[1]
local offset_top = math.floor(wininfo.height/4)
local styles = {
  position = { col = '50%', row = offset_top },
  border = { style = 'shadow', padding = { 0, 0, 0, 0 } },
  size = { width = 100 },
}
require('noice').setup {
  -- unrelated key-value's are removed/skipped.
  views = {
    cmdline_popup = vim.tbl_deep_extend('force', {}, styles, {
      win_options = { winhighlight = { Normal = 'NoiceCmdlinePopup' } },
      size = { height = 2 },
    }),
    popupmenu = vim.tbl_deep_extend('force', {}, styles, {
      win_options = { winhighlight = { Normal = 'NoiceCmdlineItems' } },
      position = { row = offset_top+2 },
      size = { height = 15 },
    }),
  },
}
MunifTanjim commented 1 year ago

This is core Neovim behavior.

For setting transparency of floating windows, check :help 'winblend'.

You can pass this option inside the win_options table.