# editor: Fix clipboard line numbers when copying from multibuffer \(\#46743\) · gitcafe/zed

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

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

Visibility: public

Requested revision: acfc71a42304a19d1c0b5753d3513c0ec0fa1547

Requested commit: acfc71a42304a19d1c0b5753d3513c0ec0fa1547

Commit: acfc71a42304a19d1c0b5753d3513c0ec0fa1547

Tree: 70e5bccd2e5f767030eeb78467fcffc29d90d14f

Author: Kavi Bidlack

Committer: GitHub

## Message

```
editor: Fix clipboard line numbers when copying from multibuffer (#46743)

Release Notes:

- When copying and pasting from a multibuffer view (e.g. into the agent
panel), the line numbers from the selection corresponded to the line
numbers in the multibuffer view (incorrect), instead of the actual line
numbers from the file itself.
- I also handled the case in which the selection spans multiple excerpts
(different files in the multibuffer) by just returning None for that
case, but maybe it should instead be split into two selections?

Left is before (bugged, should be lines 8:16, instead it is 38:46),
right is after (fixed).
<div style="display:flex; gap:12px;">
<img
src="https://github.com/user-attachments/assets/b1bfce1d-8b6a-41c0-ac7e-51f7bd7b284e"
       width="48%" />
<img
src="https://github.com/user-attachments/assets/2a4c33a0-a969-4a3e-9aa5-d2c2fefba3b2"
       width="48%" />
</div>
```

## Parents

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

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