feat: built-in select has winblend option

This commit is contained in:
Steven Arcangeli 2021-12-02 19:52:46 -08:00
parent 106dfb93a3
commit f57f0f3587
2 changed files with 4 additions and 0 deletions

View File

@ -54,6 +54,9 @@ local default_config = {
col = 0, col = 0,
border = "rounded", border = "rounded",
-- Window options
winblend = 10,
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
width = nil, width = nil,
max_width = 0.8, max_width = 0.8,

View File

@ -42,6 +42,7 @@ M.select = function(config, items, opts, on_choice)
style = "minimal", style = "minimal",
} }
local winnr = vim.api.nvim_open_win(bufnr, true, winopt) local winnr = vim.api.nvim_open_win(bufnr, true, winopt)
vim.api.nvim_win_set_option(winnr, "winblend", config.winblend)
vim.api.nvim_win_set_option(winnr, "cursorline", true) vim.api.nvim_win_set_option(winnr, "cursorline", true)
if vim.fn.exists("&cursorlineopt") ~= 0 then if vim.fn.exists("&cursorlineopt") ~= 0 then
vim.api.nvim_win_set_option(winnr, "cursorlineopt", "both") vim.api.nvim_win_set_option(winnr, "cursorlineopt", "both")