mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-29 12:38:02 +00:00
a284e7140c
Specifically, with this commit: - We will now refresh the anchor if it escapes the boundaries of the excerpt by using the `Excerpt::contains` method. This was not the case before, as we were just checking if the excerpt id and buffer id of the anchors matched the ones stored on the excerpt. - We fixed a bug that was causing the anchor to be outside of the excerpt when resetting it to one of the excerpt's endpoints after we couldn't keep its position. This would happen because we were using `anchor_at`, which resolved the anchor to an offset first and then converted it back into an anchor with the given bias, which is a lossy operation. We now use `Anchor::bias` to achieve the same goal: note that this could still lead to the anchor escaping the excerpt's boundary when the bias doesn't match the endpoint's bias, so we take extra care to avoid that and `min`/`max` the newly-produced anchor with the other endpoint. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |