(
position: Position,
vimState: VimState,
firstIteration: boolean,
lastIteration: boolean,
)
| 1461 | } |
| 1462 | |
| 1463 | public override async execActionForOperator( |
| 1464 | position: Position, |
| 1465 | vimState: VimState, |
| 1466 | firstIteration: boolean, |
| 1467 | lastIteration: boolean, |
| 1468 | ): Promise<Position> { |
| 1469 | const result = await this.execAction(position, vimState, firstIteration, lastIteration); |
| 1470 | |
| 1471 | /* |
| 1472 | From the Vim documentation: |
| 1473 | |
| 1474 | Another special case: When using the "w" motion in combination with an |
| 1475 | operator and the last word moved over is at the end of a line, the end of |
| 1476 | that word becomes the end of the operated text, not the first word in the |
| 1477 | next line. |
| 1478 | */ |
| 1479 | |
| 1480 | if ( |
| 1481 | result.line > position.line + 1 || |
| 1482 | (result.line === position.line + 1 && result.isFirstWordOfLine(vimState.document)) |
| 1483 | ) { |
| 1484 | return position.getLineEnd(); |
| 1485 | } |
| 1486 | |
| 1487 | if (result.isLineEnd(vimState.document)) { |
| 1488 | return new Position(result.line, result.character + 1); |
| 1489 | } |
| 1490 | |
| 1491 | return result; |
| 1492 | } |
| 1493 | } |
| 1494 | |
| 1495 | @RegisterAction |
nothing calls this directly
no test coverage detected