# Fix crash when joining two consecutive lines \(\#10000\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ec6efe262fd74f6c8e43e0a25f4264958f77f57c

Requested commit: ec6efe262fd74f6c8e43e0a25f4264958f77f57c

Commit: ec6efe262fd74f6c8e43e0a25f4264958f77f57c

Tree: de491539c90a74a46b7febfcb8f9916dd0cb976d

Author: Hans

Committer: GitHub

## Message

```
Fix crash when joining two consecutive lines (#10000)

Release notes:

- Fixed a crash when joining two consecutive lines
([#9692](https://github.com/zed-industries/zed/pull/9692)).


This crash is not caused by `vim` or `editor`'s code logic, `join_line`
logic is okay, I found that the crash is caused by a refresh of git
`diff` after every update, hhen git diff generates hunks, it will look
for the cursor to the beginning of a line, and judge that if the cursor
result column is greater than 0, that is, it is not the beginning of a
line, it will correct the row to the next line, I think before we forgot
here that I need to adjust the column to 0 at the same time, otherwise
it is easy to go out of bounds, I am not sure if I need to add more
tests for this method, I can add if I need to, but I feel that this case
is a bit extreme

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
```

## Parents

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

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