Wait for Neovim
nvim_waitBlock until the Neovim UI reaches a desired state, preventing race conditions when observing the screen. On timeout, the captured screen enables quick diagnosis.
Instructions
Block until a screen condition holds, so an observation is not raced against the redraw it is meant to see. On timeout the error includes the screen as it was, so a failed wait is diagnosable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Required for contains and not-contains. | |
| idleMs | No | Quiet period for the idle condition. Default 100. | |
| condition | Yes | redraw: next completed frame. screen-change: rendered text differs from now. idle: no redraw for idleMs, the safest choice after an action that triggers several frames. contains/not-contains: wait for text to appear/disappear on screen. | |
| sessionId | Yes | Session id returned by nvim_launch or nvim_attach. | |
| timeoutMs | No | Give up after this long. Default 5000. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| waitedMs | Yes | ||
| condition | Yes | ||
| sessionId | Yes |