From abba465d6026186fc4b94d8a647087fb144280ac Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Tue, 19 Mar 2024 06:58:42 -0400 Subject: [PATCH] fix(api): Apply `itemgroup` filter correctly --- lua/legendary/ui/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/legendary/ui/init.lua b/lua/legendary/ui/init.lua index 17aa10e..9a5b76e 100644 --- a/lua/legendary/ui/init.lua +++ b/lua/legendary/ui/init.lua @@ -32,7 +32,7 @@ local function select_inner(opts, context, itemlist) if itemlist then Log.trace('Launching select UI') - else + elseif opts.itemgroup then Log.trace('Relaunching select UI for an item group') -- if no itemlist passed, try to use itemgroup -- if an item group id is specified, use that @@ -42,6 +42,8 @@ local function select_inner(opts, context, itemlist) else Log.error('Expected itemlist, got %s.\n %s', type(itemlist), vim.inspect(itemlist)) end + else + itemlist = State.items end local prompt = opts.select_prompt or Config.select_prompt @@ -105,7 +107,7 @@ end function M.select(opts) vim.cmd('doautocmd User LegendaryUiPre') local context = Executor.build_context() - select_inner(opts, context, State.items) + select_inner(opts, context) end return M