# Fix cursor going to the end of file when LSP formatter uses CRLF line endings \(\#59151\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d87dfaa4b33d5f686586fcb5dacdab3b30fef8f4

Requested commit: d87dfaa4b33d5f686586fcb5dacdab3b30fef8f4

Commit: d87dfaa4b33d5f686586fcb5dacdab3b30fef8f4

Tree: a994bc7d6ebc8a0a5cf6195b4f4b0433a2a80eff

Author: qrzychu

Committer: GitHub

## Message

```
Fix cursor going to the end of file when LSP formatter uses CRLF line endings (#59151)

I got super annoyed when using Zed with F#, so I fixed it. This also
fixes other LSPs on Windows

Fix is super simple, the test fails if the fix is commented out

Closes #48367 (and probably others)


Release Notes:

- fix cursor jumping to the end of file when LSP formats the file using
CLRF line endings
```

## Parents

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

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