# settings_ui: Prevent panic when trying to configure edit prediction providers for language \(\#47162\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 09ceec0a36539b7473fd91860675800e1b80a2f5

Requested commit: 09ceec0a36539b7473fd91860675800e1b80a2f5

Commit: 09ceec0a36539b7473fd91860675800e1b80a2f5

Tree: f6d88ef004c6cc2ea5382de0b8b7cd35425f5fe0

Author: Finn Evers

Committer: GitHub

## Message

```
settings_ui: Prevent panic when trying to configure edit prediction providers for language (#47162)

Closes #46502

The issue here was that we were not looking into the sub page stack when
looking headers up, resulting in an out of bounds index. This PR fixes
this.

Due to me also fixing another small bug in the UI (and adding proper
support for the breadcrumbs), I had to move quite some stuff around here
to get this to work. Namely, I made the `sub_page_stack` a field on the
`SettingsWindow` and now only store the `active_language` in a global to
ensure that we store scroll positions properly for all sub pages. For
that to work with the edit prediction provider page, I had to remove the
struct there and could just move that into a method, which was a nice
side effect there I suppose.

Release Notes:

- Fixed a crash that could occur when trying to edit edit prediction
providers in the settings UI.
```

## Parents

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

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