# preview tabs: Allow replacing preview tab when using code navigation \(\#10730\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 20625e98adb59a2c6e26a0591fa097755e722078

Requested commit: 20625e98adb59a2c6e26a0591fa097755e722078

Commit: 20625e98adb59a2c6e26a0591fa097755e722078

Tree: ae3407aeca3a6d7e88f182c60380cebd6dbd103d

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
preview tabs: Allow replacing preview tab when using code navigation (#10730)

This PR adds support for replacing the current preview tab when using
GoToDefinition. Previously a tab, that was navigated away from, was
converted into a permanent tab and the new tab was opened as preview.

Without `enable_preview_from_code_navigation`:


https://github.com/zed-industries/zed/assets/53836821/99840724-d6ff-4738-a9c4-ee71a0001634

With `enable_preview_from_code_navigation`:


https://github.com/zed-industries/zed/assets/53836821/8c60efcb-d597-40bf-b08b-13faf5a289b6

Note: In the future I would like to improve support for the navigation
history, because right now tabs that are not "normal" project items,
e.g. FindAllReferences cannot be reopened

Release Notes:

- Added support for replacing the current preview tab when using code
navigation (`enable_preview_from_code_navigation`)
```

## Parents

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

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