( reverse: boolean, count: number, ctx: TransitionContext, )
| 463 | // ============================================================================ |
| 464 | |
| 465 | function executeRepeatFind( |
| 466 | reverse: boolean, |
| 467 | count: number, |
| 468 | ctx: TransitionContext, |
| 469 | ): void { |
| 470 | const lastFind = ctx.getLastFind() |
| 471 | if (!lastFind) return |
| 472 | |
| 473 | // Determine the effective find type based on reverse |
| 474 | let findType = lastFind.type |
| 475 | if (reverse) { |
| 476 | // Flip the direction |
| 477 | const flipMap: Record<FindType, FindType> = { |
| 478 | f: 'F', |
| 479 | F: 'f', |
| 480 | t: 'T', |
| 481 | T: 't', |
| 482 | } |
| 483 | findType = flipMap[findType] |
| 484 | } |
| 485 | |
| 486 | const result = ctx.cursor.findCharacter(lastFind.char, findType, count) |
| 487 | if (result !== null) { |
| 488 | ctx.setOffset(result) |
| 489 | } |
| 490 | } |
no test coverage detected