# vim: Fix \`ap\` text object selection when there is line wrapping \(\#35485\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/768b2de368697a559a038f65e61aff81dc99f041)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 768b2de368697a559a038f65e61aff81dc99f041

Requested commit: 768b2de368697a559a038f65e61aff81dc99f041

Commit: 768b2de368697a559a038f65e61aff81dc99f041

Tree: 144634d838b55eb0e39d26bdabd8bdb8fe8910f2

Author: Lucas Vieira

Committer: GitHub

## Message

```
vim: Fix `ap` text object selection when there is line wrapping (#35485)

In Vim mode, `ap` text object (used in `vap`, `dap`, `cap`) was
selecting multiple paragraphs when soft wrap was enabled. The bug was
caused by using DisplayRow coordinates for arithmetic instead of buffer
row coordinates in the paragraph boundary calculation.

Fix by converting to buffer coordinates before arithmetic, then back to
display coordinates for the final result.

Closes #35085

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
```

## Parents

- [e1d31cfcc3360bf50f6230d6dd5d1aafc3295c4c](https://git.cafe/gitcafe/zed/commit/e1d31cfcc3360bf50f6230d6dd5d1aafc3295c4c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/768b2de368697a559a038f65e61aff81dc99f041?format=markdown)
