[mini.test] interaction with vim.ui.select #1459
-
Contributing guidelines
Module(s)mini.test QuestionIs it possible to test user interaction with child.lua("vim.ui.select({'a', 'b'}, {}, function(c) end)")
child.type_keys("<CR>") The documentation about a hanging process says:
Is that relevant here? And if so, how can that be achieved? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Not hit-enter-prompt but it is indeed blocked and waits for user input. You can see how it looks by executing 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 |
Beta Was this translation helpful? Give feedback.
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)
insidenvim --clean
: it "blocks" Neovim and waits for user to type a number followed by<CR>
. To test exactly that, this advice works here:However, the
…