( op: Operator, findType: FindType, char: string, count: number, ctx: OperatorContext, )
| 59 | * Execute an operator with a find motion. |
| 60 | */ |
| 61 | export function executeOperatorFind( |
| 62 | op: Operator, |
| 63 | findType: FindType, |
| 64 | char: string, |
| 65 | count: number, |
| 66 | ctx: OperatorContext, |
| 67 | ): void { |
| 68 | const targetOffset = ctx.cursor.findCharacter(char, findType, count) |
| 69 | if (targetOffset === null) return |
| 70 | |
| 71 | const target = new Cursor(ctx.cursor.measuredText, targetOffset) |
| 72 | const range = getOperatorRangeForFind(ctx.cursor, target, findType) |
| 73 | |
| 74 | applyOperator(op, range.from, range.to, ctx) |
| 75 | ctx.setLastFind(findType, char) |
| 76 | ctx.recordChange({ type: 'operatorFind', op, find: findType, char, count }) |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Execute an operator with a text object. |
no test coverage detected