# Fix data loss when project settings opened with "\.zed" in \`file_scan_exclusions\` \(\#29578\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 3a212e72a4cf25159f0ec5297c1b04bcba266c86

Requested commit: 3a212e72a4cf25159f0ec5297c1b04bcba266c86

Commit: 3a212e72a4cf25159f0ec5297c1b04bcba266c86

Tree: f2dbd905145d846bf0a93c0f4d24839903042a3d

Author: Ben Kunkle

Committer: GitHub

## Message

```
Fix data loss when project settings opened with ".zed" in `file_scan_exclusions` (#29578)

Closes #28640

Before creating an entry for a file opened with `open_local_file`, make
sure it doesn't exist, in addition to checking that it isn't already
tracked in the workspace

Release Notes:

- Fixed an issue where the project settings file would be truncated when
opened with `zed: open project settings` if the ".zed" directory was
excluded from the files scanned in a workspace (in
"file_scan_exclusions")
```

## Parents

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

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