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