# language: Add auto-surround for Plain Text, JSON, and JSONC \(\#42631\) · gitcafe/zed

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

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

Visibility: public

Requested revision: abf90cc274da0a40e479cef5981bbc9da4381abb

Requested commit: abf90cc274da0a40e479cef5981bbc9da4381abb

Commit: abf90cc274da0a40e479cef5981bbc9da4381abb

Tree: 3660351217ecb098ac7853c5cfe055b90ec37704

Author: Mustaque Ahmed

Committer: GitHub

## Message

```
language: Add auto-surround for Plain Text, JSON, and JSONC (#42631)

**Summary**
When users selected text and pressed opening brackets (`(`, `[`, `{`),
the text was deleted instead of being wrapped.

- Added bracket pairs: `()`, `[]`, `{}`, `""`, `''` with `surround =
true`
- Added `surround = true` to existing bracket pairs
- Added `()` bracket pair

**Production Build Fix** (`crates/languages/src/lib.rs`)
- Fixed bug where `brackets` config was stripped in non-`load-grammars`
builds
- Preserved `brackets: config.brackets` in production mode

Closes #41186

**Screen recording**

https://github.com/user-attachments/assets/22067fe7-d5c4-4a72-a93d-8dbaae640168

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
```

## Parents

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

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