Closed liuhq closed 2 months ago
Thanks for the detailed question!
This doesn't look like an issue with 'mini.sessions', but rather a code snippet from 'nui.nvim'. The reason is that input items to vim.ui.select()
are plain strings. The 'nui.nvim' code has the line of local format_item = opts.format_item or function(item) return tostring(item.__raw_item or item) end
(meaning format_item
is equal to opts.format_item
if it is supplied) which later is used with the transformed item (after if type(item) ~= 'table' then item = { __raw_item = item } end
) and not with the original item. This is not according to the specification, see :h vim.ui.select()
.
Contributing guidelines
Module(s)
mini.sessions
Description
when using nui to take over vim.ui.select (code like below 👇)
https://github.com/MunifTanjim/nui.nvim/wiki/vim.ui#vimuiselect
require('mini.sessions').select('read') will get a error 👇
I read the mini.sessions source code and find the error maybe happen in 👇
nui the error-related code maybe as follows 👇
and
But I don't know the bug which is from nui code or mini.sessions
Neovim version
0.10
Steps to reproduce
require('mini.sessions').select('read')
Expected behavior
No response
Actual behavior
An error occurred