From f7946bd2547cf5e328ea7f303a7a5b691a12cf66 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 13 Mar 2022 01:32:43 +1100 Subject: [PATCH] feat: winblend --- README.md | 1 + doc/symbols-outline.txt | 10 ++++++++++ lua/symbols-outline/config.lua | 1 + lua/symbols-outline/preview.lua | 3 +++ 4 files changed, 15 insertions(+) diff --git a/README.md b/README.md index c2b3a85..a0813d2 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ vim.g.symbols_outline = { | show_relative_numbers | Shows relative numbers with the outline | boolean | false | | show_symbol_details | Shows extra details with the symbols (lsp dependent) | boolean | true | | preview_bg_highlight | Background color of the preview window | string | Pmenu | +| winblend | Pseudo-transparency of the preview window | int | 0 | | keymaps | Which keys do what | table (dictionary) | [here](#default-keymaps) | | symbols | Icon and highlight config for symbol icons | table (dictionary) | scroll up | | lsp_blacklist | Which lsp clients to ignore | table (array) | {} | diff --git a/doc/symbols-outline.txt b/doc/symbols-outline.txt index 0748963..1387c60 100644 --- a/doc/symbols-outline.txt +++ b/doc/symbols-outline.txt @@ -198,6 +198,16 @@ preview_bg_highlight Type: string +----------------------------------------------------------------------------- +winblend + + Pseudo-transparency of the preview window (value between `0` and `100`) + See `:h winblend` + + Default: 0 + + Type: int + ----------------------------------------------------------------------------- keymaps diff --git a/lua/symbols-outline/config.lua b/lua/symbols-outline/config.lua index d09e64a..fe2a45f 100644 --- a/lua/symbols-outline/config.lua +++ b/lua/symbols-outline/config.lua @@ -15,6 +15,7 @@ M.defaults = { show_relative_numbers = false, show_symbol_details = true, preview_bg_highlight = 'Pmenu', + winblend = 0, keymaps = { -- These keymaps can be a string or a table for multiple keys close = { '', 'q' }, goto_location = '', diff --git a/lua/symbols-outline/preview.lua b/lua/symbols-outline/preview.lua index 9b9a28b..04302d7 100644 --- a/lua/symbols-outline/preview.lua +++ b/lua/symbols-outline/preview.lua @@ -151,6 +151,9 @@ local function set_bg_hl() local winhi = 'Normal:' .. config.options.preview_bg_highlight vim.api.nvim_win_set_option(state.preview_win, 'winhighlight', winhi) vim.api.nvim_win_set_option(state.hover_win, 'winhighlight', winhi) + local winblend = config.options.winblend + vim.api.nvim_win_set_option(state.preview_win, 'winblend', winblend) + vim.api.nvim_win_set_option(state.hover_win, 'winblend', winblend) end local function show_preview()