# Only allow save_as for pane if can_save_as is true \(\#25028\) · gitcafe/zed

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

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

Visibility: public

Requested revision: bb53ad9862684acce0f80230ec7559878e440a82

Requested commit: bb53ad9862684acce0f80230ec7559878e440a82

Commit: bb53ad9862684acce0f80230ec7559878e440a82

Tree: 319a9f41509eca1688f7364ae4229e4b46e7d496

Author: Dylan

Committer: GitHub

## Message

```
Only allow save_as for pane if can_save_as is true (#25028)

When saving an item, some logic is done to determine whether one can
save it. In the special case where the intent is to `SaveAs`, it was
previously allowed to proceed as long as the buffer was a singleton
(presumably since it only makes sense to provide a save path for a
single file). However, we need to _also_ check that this item can be
"saved as" at all.

For this, we resurrect the `ItemHandle`/`Item` trait method
`can_save_as`. We have given it the default implementation of returning
`false`, and then overridden this in the implementation for
`TerminalView`.

Closes #25023


Release Notes:

- Fixed crash when trying to save terminal buffer

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
```

## Parents

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

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