mirror of
https://github.com/hrsh7th/nvim-cmp
synced 2024-09-16 20:54:03 +02:00
feat: make winblend configurable (#1861)
This commit is contained in:
parent
c34fa793ea
commit
97dc716fc9
5 changed files with 11 additions and 2 deletions
|
@ -696,6 +696,12 @@ window.{completion,documentation}.border~
|
|||
window.{completion,documentation}.winhighlight~
|
||||
`string | cmp.WinhighlightConfig`
|
||||
Specify the window's winhighlight option.
|
||||
See |nvim_open_win|.
|
||||
|
||||
*cmp-config.window.{completion,documentation}.winblend*
|
||||
window.{completion,documentation}.winblend~
|
||||
`string | cmp.WinhighlightConfig`
|
||||
Specify the window's winblend option.
|
||||
See |nvim_open_win|.
|
||||
|
||||
*cmp-config.window.{completion,documentation}.zindex*
|
||||
|
|
|
@ -107,6 +107,7 @@ return function()
|
|||
completion = {
|
||||
border = { '', '', '', '', '', '', '', '' },
|
||||
winhighlight = 'Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None',
|
||||
winblend = vim.o.pumblend,
|
||||
scrolloff = 0,
|
||||
col_offset = 0,
|
||||
side_padding = 1,
|
||||
|
@ -117,6 +118,7 @@ return function()
|
|||
max_width = math.floor((WIDE_HEIGHT * 2) * (vim.o.columns / (WIDE_HEIGHT * 2 * 16 / 9))),
|
||||
border = { '', '', '', ' ', '', '', '', ' ' },
|
||||
winhighlight = 'FloatBorder:NormalFloat',
|
||||
winblend = vim.o.pumblend,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -121,6 +121,7 @@ cmp.ItemField = {
|
|||
---@class cmp.WindowOptions
|
||||
---@field public border? string|string[]
|
||||
---@field public winhighlight? string
|
||||
---@field public winblend? number
|
||||
---@field public zindex? integer|nil
|
||||
|
||||
---@class cmp.CompletionWindowOptions: cmp.WindowOptions
|
||||
|
|
|
@ -201,7 +201,7 @@ custom_entries_view.open = function(self, offset, entries)
|
|||
end
|
||||
|
||||
-- Apply window options (that might be changed) on the custom completion menu.
|
||||
self.entries_win:option('winblend', vim.o.pumblend)
|
||||
self.entries_win:option('winblend', completion.winblend)
|
||||
self.entries_win:option('winhighlight', completion.winhighlight)
|
||||
self.entries_win:option('scrolloff', completion.scrolloff)
|
||||
self.entries_win:open({
|
||||
|
|
|
@ -100,7 +100,7 @@ docs_view.open = function(self, e, view)
|
|||
end
|
||||
|
||||
-- Render window.
|
||||
self.window:option('winblend', vim.o.pumblend)
|
||||
self.window:option('winblend', documentation.winblend)
|
||||
self.window:option('winhighlight', documentation.winhighlight)
|
||||
local style = {
|
||||
relative = 'editor',
|
||||
|
|
Loading…
Reference in a new issue