# Compute diffs based on characters rather than lines · gitcafe/zed

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

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

Visibility: public

Requested revision: 71128d2ee6b55824c393f2b2b97f2504a86963c0

Requested commit: 71128d2ee6b55824c393f2b2b97f2504a86963c0

Commit: 71128d2ee6b55824c393f2b2b97f2504a86963c0

Tree: 17eddd4fd7f3b6aa8cea3e64ac4bb3f4e17824eb

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Compute diffs based on characters rather than lines

Previously, a change on a given line would cause that whole line to be
replaced. In turn, this caused anchors on that line to go to the start
of that line because they would lie inside of a deleted region after applying
the diff.

By switching to a character-wise diff, we perform smaller edits to the buffer
which stabilizes anchor positions.

```

## Parents

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

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