# Restore editor state on reopen \(\#27672\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e11e7df724d1c959ec63de94b65c351916c291b1

Requested commit: e11e7df724d1c959ec63de94b65c351916c291b1

Commit: e11e7df724d1c959ec63de94b65c351916c291b1

Tree: 16d24b6aee2ebfb7b2599020c3f13a7f581ff01b

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Restore editor state on reopen (#27672)

Closes https://github.com/zed-industries/zed/issues/11626
Part of https://github.com/zed-industries/zed/issues/12853

`"restore_on_file_reopen": true` in workspace settings can now be used
to enable and disable editor data between file reopens in the same pane:


https://github.com/user-attachments/assets/8d938ee1-d854-42a8-bbc3-2a4e4d7d5933

The settings are generic and panes' data store can be extended for
further entities, beyond editors.

---------------
Impl details: 

Currently, the project entry IDs seem to be stable across file reopens,
unlike BufferIds, so those were used.
Originally, the DB data was considered over in-memory one as editors
serialize their state anyway, but managing and exposing PaneIds out of
the DB is quite tedious and joining the DB data otherwise is not
possible.


Release Notes:

- Started to restore editor state on reopen
```

## Parents

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

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