# gpui: Fix \`shape_text\` split to support \\r\\n \(\#31022\) · gitcafe/zed

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

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

Visibility: public

Requested revision: b7d5e6480abf6625fbf962176ecdc024f742a49a

Requested commit: b7d5e6480abf6625fbf962176ecdc024f742a49a

Commit: b7d5e6480abf6625fbf962176ecdc024f742a49a

Tree: b315660fd12959b199f451353776e668b93ff37d

Author: Jason Lee

Committer: GitHub

## Message

```
gpui: Fix `shape_text` split to support \r\n (#31022)

Release Notes:

- N/A

---

Today I check the shape_text result on Windows, I get:

<img width="409" alt="屏幕截图 2025-05-20 222908"
src="https://github.com/user-attachments/assets/3ee93911-3de1-4e01-9433-00c626fc2369"
/>

Here the `shape_text` split logic I think it should use `lines` method,
not `split('\n')`, the newline on Windows is `\r\n`.
```

## Parents

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

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