# User buffer column range when adding selection that skips soft wrap \(\#45594\) · gitcafe/zed

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

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

Visibility: public

Requested revision: feb3ce3638f4be201ef8ab8b6e6c4f4f38fd0b1a

Requested commit: feb3ce3638f4be201ef8ab8b6e6c4f4f38fd0b1a

Commit: feb3ce3638f4be201ef8ab8b6e6c4f4f38fd0b1a

Tree: a8abedb68f99838b257f68f4953dca3f94b0570c

Author: Dino

Committer: GitHub

## Message

`````
User buffer column range when adding selection that skips soft wrap (#45594)

When adding selections above/below with `skip_soft_wrap: true`, use
buffer column positions instead of pixel positions. This ensures
selections are placed at the same column offset in the buffer rather
than at the same visual position, which was incorrect for soft-wrapped
lines.

For example, selecting "how" in a wrapped line:

````
1. Very long line to
   show [how] a wrapped
   line would look
2. Very long line to
   show how a wrapped
   line would look
````

Now correctly adds a selection at the same buffer column in the next
line:

````
1. Very long line to
   show [how] a wrapped
   line would look
2. Very long line to
   show [how] a wrapped
   line would look
````

Closes #42137

Release Notes:

- Improved `editor: add selection above` and `editor: add selection
below` to select at the same text column when skipping soft-wrapped
lines, instead of the same visual position
`````

## Parents

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

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