From fd9d93a770840e25c237ab4616e4208f43d7294e Mon Sep 17 00:00:00 2001 From: bhagwan Date: Mon, 14 Feb 2022 11:39:24 -0800 Subject: [PATCH] vim.ui.select: fallback when opts have no 'format_item' (closes #346) --- lua/fzf-lua/providers/ui_select.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/fzf-lua/providers/ui_select.lua b/lua/fzf-lua/providers/ui_select.lua index 1e9f2fd..ebfa152 100644 --- a/lua/fzf-lua/providers/ui_select.lua +++ b/lua/fzf-lua/providers/ui_select.lua @@ -76,7 +76,7 @@ M.ui_select = function(items, opts, on_choice) for i, e in ipairs(items) do table.insert(entries, ("%s. %s"):format(utils.ansi_codes.magenta(tostring(i)), - opts.format_item(e))) + opts.format_item and opts.format_item(e) or tostring(e))) end local prompt = opts.prompt