# windows: Remove extra empty line when loading default settings \(\#30344\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d8980c25d283dcbecae1b48e920775b4fcba3ea7

Requested commit: d8980c25d283dcbecae1b48e920775b4fcba3ea7

Commit: d8980c25d283dcbecae1b48e920775b4fcba3ea7

Tree: e4a74027d54593f0388282a9a11b3ac1cd8840f4

Author: 张小白

Committer: GitHub

## Message

```
windows: Remove extra empty line when loading default settings (#30344)

On Windows, lines in a file end with `\r\n`, so using
`chunk.split('\n')` leaves a trailing `\r` at the end of each line. This
ends up introducing extra blank lines in the final output.

I didn't use `chunk.split('\r\n')` because some of the input have
already had its line endings normalized to just `\n`. If we switch to
splitting on `\r\n`, that input wouldn't be handled correctly.

#### Before


https://github.com/user-attachments/assets/22cc5a79-c3a7-4824-a3bc-d66d2261852f

#### After



https://github.com/user-attachments/assets/720f1d67-75e6-482d-b6a5-9f3aa9f321ce



Release Notes:

- N/A
```

## Parents

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

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