# WIP \- Serialize buffer in terms of its state, not its base text \+ ops · gitcafe/zed

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

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

Visibility: public

Requested revision: 984e366c32150135f2ff2126b70c2bdca946e308

Requested commit: 984e366c32150135f2ff2126b70c2bdca946e308

Commit: 984e366c32150135f2ff2126b70c2bdca946e308

Tree: 8f589e99a52a35821388e0e5320fbdd2e85945dd

Author: Max Brunsfeld

Committer: Max Brunsfeld

## Message

```
WIP - Serialize buffer in terms of its state, not its base text + ops

The main reason for this is that we need to include information about
a buffer's UndoMap into its protobuf representation. But it's a bit
complex to correctly incorporate this information into the current
protobuf representation.

If we want to continue reusing `Buffer::apply_remote_edit` for
incorporating the historical operations, we need to either make
that method capable of incorporating already-undone edits, or
serialize the UndoMap into undo *operations*, so that we can apply
these undo operations after the fact when deserializing. But this is
not trivial, because an UndoOperation requires information about
the full offset ranges that were undone.

```

## Parents

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

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