diff --git a/README.md b/README.md index b0843c05..b8fa3938 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,7 @@ MiniDeps.add({ sources = { -- list of enabled providers - completion = { + completion = { enabled_providers = { 'lsp', 'path', 'snippets', 'buffer' }, } @@ -390,6 +390,7 @@ MiniDeps.add({ min_width = 15, max_height = 10, border = 'none', + winblend = 0, winhighlight = 'Normal:BlinkCmpMenu,FloatBorder:BlinkCmpMenuBorder,CursorLine:BlinkCmpMenuSelection,Search:None', -- keep the cursor X lines away from the top/bottom of the window scrolloff = 2, @@ -422,6 +423,7 @@ MiniDeps.add({ max_width = 60, max_height = 20, border = 'padded', + winblend = 0, winhighlight = 'Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,CursorLine:BlinkCmpDocCursorLine,Search:None', -- which directions to show the documentation window, -- for each of the possible autocomplete window directions, @@ -440,6 +442,7 @@ MiniDeps.add({ max_width = 100, max_height = 10, border = 'padded', + winblend = 0, winhighlight = 'Normal:BlinkCmpSignatureHelp,FloatBorder:BlinkCmpSignatureHelpBorder', -- which directions to show the window, diff --git a/lua/blink/cmp/config.lua b/lua/blink/cmp/config.lua index 13abe54f..6e2e2585 100644 --- a/lua/blink/cmp/config.lua +++ b/lua/blink/cmp/config.lua @@ -116,6 +116,7 @@ --- @field direction_priority? ("n" | "s")[] --- @field auto_show? boolean --- @field selection? "preselect" | "manual" | "auto_insert" +--- @field winblend? number --- @field winhighlight? string --- @field scrolloff? number --- @field draw? 'simple' | 'reversed' | 'minimal' | blink.cmp.CompletionDrawFn @@ -141,6 +142,7 @@ --- @field auto_show? boolean --- @field auto_show_delay_ms? number Delay before showing the documentation window --- @field update_delay_ms? number Delay before updating the documentation window +--- @field winblend? number --- @field winhighlight? string --- @class blink.cmp.SignatureHelpConfig @@ -148,6 +150,7 @@ --- @field max_width? number --- @field max_height? number --- @field border? blink.cmp.WindowBorder +--- @field winblend? number --- @field winhighlight? string --- @field direction_priority? ("n" | "s")[] @@ -363,6 +366,7 @@ local config = { min_width = 15, max_height = 10, border = 'none', + winblend = 0, winhighlight = 'Normal:BlinkCmpMenu,FloatBorder:BlinkCmpMenuBorder,CursorLine:BlinkCmpMenuSelection,Search:None', -- keep the cursor X lines away from the top/bottom of the window scrolloff = 2, @@ -397,6 +401,7 @@ local config = { max_width = 80, max_height = 20, border = 'padded', + winblend = 0, winhighlight = 'Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,CursorLine:BlinkCmpDocCursorLine,Search:None', -- which directions to show the documentation window, -- for each of the possible autocomplete window directions, @@ -415,6 +420,7 @@ local config = { max_width = 100, max_height = 10, border = 'padded', + winblend = 0, winhighlight = 'Normal:BlinkCmpSignatureHelp,FloatBorder:BlinkCmpSignatureHelpBorder', -- which directions to show the window, diff --git a/lua/blink/cmp/windows/autocomplete.lua b/lua/blink/cmp/windows/autocomplete.lua index a09653f8..8d501d2f 100644 --- a/lua/blink/cmp/windows/autocomplete.lua +++ b/lua/blink/cmp/windows/autocomplete.lua @@ -77,6 +77,7 @@ function autocomplete.setup() min_width = autocmp_config.min_width, max_height = autocmp_config.max_height, border = autocmp_config.border, + winblend = autocmp_config.winblend, winhighlight = autocmp_config.winhighlight, cursorline = false, scrolloff = autocmp_config.scrolloff, diff --git a/lua/blink/cmp/windows/documentation.lua b/lua/blink/cmp/windows/documentation.lua index ace0c664..c0eadfc9 100644 --- a/lua/blink/cmp/windows/documentation.lua +++ b/lua/blink/cmp/windows/documentation.lua @@ -10,6 +10,7 @@ function docs.setup() max_width = config.max_width, max_height = config.max_height, border = config.border, + winblend = config.winblend, winhighlight = config.winhighlight, wrap = true, filetype = 'markdown', diff --git a/lua/blink/cmp/windows/lib/init.lua b/lua/blink/cmp/windows/lib/init.lua index 9a05598c..bfd6540f 100644 --- a/lua/blink/cmp/windows/lib/init.lua +++ b/lua/blink/cmp/windows/lib/init.lua @@ -49,6 +49,7 @@ function win.new(config) border = config.border or 'none', wrap = config.wrap or false, filetype = config.filetype or 'cmp_menu', + winblend = config.winblend or 0, winhighlight = config.winhighlight or 'Normal:NormalFloat,FloatBorder:NormalFloat', scrolloff = config.scrolloff or 0, } @@ -90,6 +91,7 @@ function win:open() zindex = 1001, border = self.config.border == 'padded' and { ' ', '', '', ' ', '', '', ' ', ' ' } or self.config.border, }) + vim.api.nvim_set_option_value('winblend', self.config.winblend, { win = self.id }) vim.api.nvim_set_option_value('winhighlight', self.config.winhighlight, { win = self.id }) vim.api.nvim_set_option_value('wrap', self.config.wrap, { win = self.id }) vim.api.nvim_set_option_value('foldenable', false, { win = self.id }) diff --git a/lua/blink/cmp/windows/signature.lua b/lua/blink/cmp/windows/signature.lua index 8afa1029..008e851e 100644 --- a/lua/blink/cmp/windows/signature.lua +++ b/lua/blink/cmp/windows/signature.lua @@ -9,6 +9,7 @@ function signature.setup() max_width = config.max_width, max_height = config.max_height, border = config.border, + winblend = config.winblend, winhighlight = config.winhighlight, wrap = true, filetype = 'markdown',