# Fix opening excerpt when the cursor is at the end of a multi-buffer \(\#2522\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7534c4e670a278122b9e3a6cd793a671bdafe211

Requested commit: 7534c4e670a278122b9e3a6cd793a671bdafe211

Commit: 7534c4e670a278122b9e3a6cd793a671bdafe211

Tree: bc11ce8b37d228a317df512e0959f13de6552f15

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Fix opening excerpt when the cursor is at the end of a multi-buffer (#2522)

Fixes
https://linear.app/zed-industries/issue/Z-987/option-enter-doesnt-open-buffer-from-multibuffer-if-on-the-last-line

This was caused by seeking with a right bias, which in the case of the
last excerpt in the buffer would seek past the end of the buffer. This
commit changes the behavior to move the cursor back to the previous
excerpt if we overshoot, to ensure we always land on an excerpt.

Release Notes:

- Fixed a bug that prevented opening excerpts when the cursor was at the
end of a multi-buffer.
```

## Parents

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

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

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