Skip to content

Remove old Buffer branching APIs#53342

Open
maxbrunsfeld wants to merge 2 commits intomainfrom
remove-old-buffer-apis
Open

Remove old Buffer branching APIs#53342
maxbrunsfeld wants to merge 2 commits intomainfrom
remove-old-buffer-apis

Conversation

@maxbrunsfeld
Copy link
Copy Markdown
Collaborator

Buffer::branch was one API of many standing in the way of adopting a new CRDT as the basis for our buffer. This PR removes it, and adjusts its one legitimate user, Buffer::preview_edits to use a different, simpler API, BufferSnapshot::edit, that lets us apply edits a buffer snapshot that will never be merged into the main buffer.

Release Notes:

  • N/A

Update preview_edits to use a new simpler API, BufferSnapshot::edit,
that applies edits to a buffer snapshot without affecting its original
buffer.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 7, 2026
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Apr 7, 2026
@maxbrunsfeld maxbrunsfeld force-pushed the remove-old-buffer-apis branch from 8e54e3e to 8b943c6 Compare April 8, 2026 03:44
@maxbrunsfeld
Copy link
Copy Markdown
Collaborator Author

@as-cii I changed the method to Buffer::snapshot_with_edits to avoid the problematic case of making repeated edits to a snapshot. I stayed with the distinct replica id for now, to avoid having to tick the main buffer's lamport every time we preview an edit prediction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant