Skip to content

[mini.test] interaction with vim.ui.select #1459

Closed Answered by echasnovski
bennorichters asked this question in Q&A
Discussion options

You must be logged in to vote

The documentation about a hanging process says:

Common causes are active hit-enter-prompt (solution: increase prompt height to a bigger value)

Is that relevant here? And if so, how can that be achieved?

Not hit-enter-prompt but it is indeed blocked and waits for user input. You can see how it looks by executing :lua vim.ui.select({'a', 'b'}, {}, function(c) _G.info = c end) inside nvim --clean: it "blocks" Neovim and waits for user to type a number followed by <CR>. To test exactly that, this advice works here:

child.lua_notify("vim.ui.select({'a', 'b'}, {}, function(item, idx) _G.info = { item, idx } end)")
child.type_keys('1<CR>')
eq(child.lua_get('_G.info'), { 'a', 1 })

However, the

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bennorichters
Comment options

Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.test
2 participants