-
Notifications
You must be signed in to change notification settings - Fork 293
Open
Labels
Description
Hi, thanks for mini.nvim, I use it every day.
I hit an issue with mini.pick when it's used as the vim.ui.select backend. When items passed to vim.ui.select contain userdata (like uv.uv_timer_t handles), mini.pick crashes because vim.deepcopy() can't handle userdata.
Error: Cannot deepcopy object of type userdata
It happens in H.validate_picker_opts() at line 2077 where it does:
opts = vim.deepcopy(H.get_config(opts))
This deepcopies everything including source.items. If any item has userdata in it, it breaks.
I ran into this with sidekick.nvim - it passes state objects to vim.ui.select, and some of those have terminal objects with uv timer handles inside.
A couple ideas for fixing it:
- Use shallow copy or selective copy instead of full deepcopy
- Wrap the deepcopy in pcall and fall back to the original if it fails
- Or just note in the docs that items shouldn't have userdata
Let me know if you want me to test anything.
Reactions are currently unavailable