# agent_ui: Autoscroll after inserting selections \(\#41370\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c42d54af175721913ea2b67ce5b8a268262812ae

Requested commit: c42d54af175721913ea2b67ce5b8a268262812ae

Commit: c42d54af175721913ea2b67ce5b8a268262812ae

Tree: fb8fd9c56ee362a273bc8b3bacf3dd758443fbbb

Author: Dino

Committer: GitHub

## Message

```
agent_ui: Autoscroll after inserting selections (#41370)

Update the behavior of the `zed_actions::agent::AddSelectionToThread`
action so that, after the selecitons are added to the current thread,
the editor automatically scrolls to the cursor's position, fixing an
issue where the inserted selection's UI component could wrap the cursor
to the next line below, leaving it outside the viewable area.

Closes #39694

Release Notes:

- Improved the `agent: add selection to thread` action so as to
automatically scroll to the cursor's position after selections are
inserted
```

## Parents

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

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