fix(select/telescope): check for nil selection

This commit is contained in:
William Boman 2021-12-06 01:29:37 +01:00
parent 7e6e962341
commit c84bf85c28
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,10 @@ M.select = function(config, items, opts, on_choice)
actions.select_default:replace(function()
local selection = state.get_selected_entry()
actions._close(prompt_bufnr, false)
if not selection then
-- User did not select anything.
return
end
local idx = nil
for i, item in ipairs(items) do
if item == selection.value then