diff --git a/lua/telescope/_extensions/ui-select.lua b/lua/telescope/_extensions/ui-select.lua index 7e60ba2..0ba2e73 100644 --- a/lua/telescope/_extensions/ui-select.lua +++ b/lua/telescope/_extensions/ui-select.lua @@ -130,13 +130,15 @@ return require("telescope").register_extension { attach_mappings = function(prompt_bufnr) actions.select_default:replace(function() local selection = action_state.get_selected_entry() + local cb = on_choice + on_choice = function(_, _) end actions.close(prompt_bufnr) if selection == nil then utils.__warn_no_selection "ui-select" - on_choice(nil, nil) + cb(nil, nil) return end - on_choice(selection.value.text, selection.value.idx) + cb(selection.value.text, selection.value.idx) end) actions.close:enhance { post = function()