# Fix inline assistant not working at the start/end of a file \(\#13384\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ed9f6e2141efa30f3b311d325f93211554f734d7

Requested commit: ed9f6e2141efa30f3b311d325f93211554f734d7

Commit: ed9f6e2141efa30f3b311d325f93211554f734d7

Tree: bbc998ea14c77aef79effeddd9623dd58893a718

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Fix inline assistant not working at the start/end of a file (#13384)

This was due to a bug in the `MultiBufferSnapshot::excerpts_in_ranges`
method. As part of this, I took the chance to rewrite that logic and
simplify it a bit.

Release Notes:

- N/A
```

## Parents

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

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