Make the pum window property respect future changes of &pumblend (#313)

PR #310 added a support for the pumblend property for the custom
floating completion pop-up menu, but the winblend option is set
globally which doesn't respect future changes (e.g., `set pumblend=..`).

Such window options for the pop-up window that might be changed later
would need to be set when the floating window is being opened.
This commit is contained in:
Jongwook Choi
2021-10-09 12:33:36 -04:00
committed by GitHub
parent 20b99bc54b
commit 68f7eeb3f0

View File

@@ -26,7 +26,6 @@ custom_entries_view.new = function()
self.entries_win:option('foldenable', false) self.entries_win:option('foldenable', false)
self.entries_win:option('wrap', false) self.entries_win:option('wrap', false)
self.entries_win:option('scrolloff', 0) self.entries_win:option('scrolloff', 0)
self.entries_win:option('winblend', vim.opt.pumblend:get())
self.entries_win:option('winhighlight', 'Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None') self.entries_win:option('winhighlight', 'Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None')
self.event = event.new() self.event = event.new()
self.offset = -1 self.offset = -1
@@ -95,6 +94,9 @@ custom_entries_view.open = function(self, offset, entries)
self.column_bytes = { abbr = 0, kind = 0, menu = 0 } self.column_bytes = { abbr = 0, kind = 0, menu = 0 }
self.column_width = { abbr = 0, kind = 0, menu = 0 } self.column_width = { abbr = 0, kind = 0, menu = 0 }
-- Apply window options (that might be changed) on the custom completion menu.
self.entries_win:option('winblend', vim.opt.pumblend:get())
local lines = {} local lines = {}
local dedup = {} local dedup = {}
local preselect = 0 local preselect = 0