(
state: { type: 'replace'; count: number },
input: string,
ctx: TransitionContext,
)
| 436 | } |
| 437 | |
| 438 | function fromReplace( |
| 439 | state: { type: 'replace'; count: number }, |
| 440 | input: string, |
| 441 | ctx: TransitionContext, |
| 442 | ): TransitionResult { |
| 443 | // Backspace/Delete arrive as empty input in literal-char states. In vim, |
| 444 | // r<BS> cancels the replace; without this guard, executeReplace("") would |
| 445 | // delete the character under the cursor instead. |
| 446 | if (input === '') return { next: { type: 'idle' } } |
| 447 | return { execute: () => executeReplace(input, state.count, ctx) } |
| 448 | } |
| 449 | |
| 450 | function fromIndent( |
| 451 | state: { type: 'indent'; dir: '>' | '<'; count: number }, |
no test coverage detected