Skip to content

[mini.test] Why type_keys uses async nvim_input instead of sync nvim_feedkeys? #1336

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

You must be logged in to vote

I don't quite remember the details, but I think it was a combination of several things:

  • In various tests nvim_input() should to be a closer way to emulate how user presses keys. Specifically because it is non-blocking. With default zero wait each argument's keys just happens instantaneously while arguments are separated by event loop calls.
  • I think blocking nature of nvim_feedkeys() was an obstacle for some cases of testing key sequences that block the editor. Like pressing d puts Neovim in Operator-pending mode which awaits user input. But I am not 100% sure here.

We're sending keys to a child process to test for their effect, but we don't know how long we should wait until that effec…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@powerman
Comment options

@echasnovski
Comment options

@powerman
Comment options

@echasnovski
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
2 participants