* Get the range for a find-based operator. * Note: _findType is unused because Cursor.findCharacter already adjusts * the offset for t/T motions. All find types are treated as inclusive here.
( cursor: Cursor, target: Cursor, _findType: FindType, )
| 480 | * the offset for t/T motions. All find types are treated as inclusive here. |
| 481 | */ |
| 482 | function getOperatorRangeForFind( |
| 483 | cursor: Cursor, |
| 484 | target: Cursor, |
| 485 | _findType: FindType, |
| 486 | ): { from: number; to: number } { |
| 487 | const from = Math.min(cursor.offset, target.offset) |
| 488 | const maxOffset = Math.max(cursor.offset, target.offset) |
| 489 | const to = cursor.measuredText.nextOffset(maxOffset) |
| 490 | return { from, to } |
| 491 | } |
| 492 | |
| 493 | function applyOperator( |
| 494 | op: Operator, |
no test coverage detected