* 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, )
| 482 | * the offset for t/T motions. All find types are treated as inclusive here. |
| 483 | */ |
| 484 | function getOperatorRangeForFind( |
| 485 | cursor: Cursor, |
| 486 | target: Cursor, |
| 487 | _findType: FindType, |
| 488 | ): { from: number; to: number } { |
| 489 | const from = Math.min(cursor.offset, target.offset) |
| 490 | const maxOffset = Math.max(cursor.offset, target.offset) |
| 491 | const to = cursor.measuredText.nextOffset(maxOffset) |
| 492 | return { from, to } |
| 493 | } |
| 494 | |
| 495 | function applyOperator( |
| 496 | op: Operator, |
no test coverage detected