# editor: Fix duplicate and copy line newlines \(\#39610\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c1e3958c263dbf748349c3e4eb83f1200db7395b

Requested commit: c1e3958c263dbf748349c3e4eb83f1200db7395b

Commit: c1e3958c263dbf748349c3e4eb83f1200db7395b

Tree: 2b9d7d340665cd78e758cc8adfd1d797fd1e662c

Author: Tom Planche

Committer: GitHub

## Message

```
editor: Fix duplicate and copy line newlines (#39610)

Closes #34797 and its child #39508.


![zed-#34797-#39508](https://github.com/user-attachments/assets/48a0fe28-8b8a-480d-bffc-6abc7ff310ff)

Release Notes:

- Fixed `editor::DuplicateLineUp` duplicating the last line onto itself
when the line doesn't end with a newline (#39508)
- Fixed line copy not including a newline at end of buffer, causing
paste to occur on the same line (#34797)
```

## Parents

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

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