From 43c3e0426894aa8306dcc9149214b62c54071228 Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Sat, 23 Dec 2023 10:28:12 -0800 Subject: [PATCH] fix(ui-select): ensure prompt is visible fix(ui-select): only use virt_text if value is table --- lua/dropbar/utils/menu.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/dropbar/utils/menu.lua b/lua/dropbar/utils/menu.lua index be3c7fe3..83f9f3e6 100644 --- a/lua/dropbar/utils/menu.lua +++ b/lua/dropbar/utils/menu.lua @@ -122,7 +122,7 @@ function M.select(items, opts, on_choice) return require('dropbar.menu').dropbar_menu_entry_t:new({ -- virt_text will only be shown if returned from `format_item` - virt_text = virt_text, + virt_text = type(virt_text) == 'table' and virt_text, components = { require('dropbar.bar').dropbar_symbol_t:new({ icon = ' ', @@ -140,10 +140,12 @@ function M.select(items, opts, on_choice) end) :totable() - local border, title_pos + local border if opts.prompt then border = require('dropbar.configs').opts.menu.win_configs.border - title_pos = 'center' + if border == 'none' then + border = { ' ', ' ', ' ', '', '', '', '', '' } + end end local menu = require('dropbar.menu').dropbar_menu_t:new({ @@ -155,7 +157,6 @@ function M.select(items, opts, on_choice) row = 1, col = 1, border = border, - title_pos = title_pos, }, })