(position: Position, vimState: VimState)
| 480 | keys = ['a', 'p']; |
| 481 | |
| 482 | public async execAction(position: Position, vimState: VimState): Promise<IMovement> { |
| 483 | vimState.currentRegisterMode = RegisterMode.LineWise; |
| 484 | |
| 485 | let start: Position; |
| 486 | const currentParagraphBegin = getCurrentParagraphBeginning(position, true); |
| 487 | |
| 488 | if (vimState.document.lineAt(position).isEmptyOrWhitespace) { |
| 489 | // The cursor is at an empty line, it can be both the start of next paragraph and the end of previous paragraph |
| 490 | start = getCurrentParagraphEnd(getCurrentParagraphBeginning(position, true), true); |
| 491 | } else { |
| 492 | if ( |
| 493 | currentParagraphBegin.isLineBeginning() && |
| 494 | currentParagraphBegin.isLineEnd(vimState.document) |
| 495 | ) { |
| 496 | start = currentParagraphBegin.getRightThroughLineBreaks(); |
| 497 | } else { |
| 498 | start = currentParagraphBegin; |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | // Include additional blank lines. |
| 503 | let stop = getCurrentParagraphEnd(position, true); |
| 504 | while ( |
| 505 | stop.line < vimState.document.lineCount - 1 && |
| 506 | vimState.document.lineAt(stop.getDown()).isEmptyOrWhitespace |
| 507 | ) { |
| 508 | stop = stop.with({ character: 0 }).getDown(); |
| 509 | } |
| 510 | |
| 511 | return { |
| 512 | start, |
| 513 | stop, |
| 514 | }; |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | @RegisterAction |
nothing calls this directly
no test coverage detected