# multi_buffer: Typed \`MultiBufferOffset\` \(\#42707\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c98b2d69448741fdf08828fc2814642ee6947c41

Requested commit: c98b2d69448741fdf08828fc2814642ee6947c41

Commit: c98b2d69448741fdf08828fc2814642ee6947c41

Tree: 847b38ca201fa0d12476881f79e2a323c4f6692f

Author: Lukas Wirth

Committer: GitHub

## Message

```
multi_buffer: Typed `MultiBufferOffset` (#42707)

This PR introduces a new `MultiBufferOffset` new type wrapping size. The
goal of this is to make it clear at the type level when we are
interacting with offsets of a multi buffer versus offsets of a language
/ text buffer. This improves readability of things quite a bit by making
it clear what kind of offsets one is working with while also reducing
accidental bugs by using the wrong kin of offset for the wrong API.

This PR also uncovered two minor bugs due to that.

Does not yet introduce the MultiBufferPoint equivalent, that is for a
follow up PR.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
```

## Parents

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

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