# Surround selection with backticks in Rust, C, and C\+\+ comments \(\#58674\) · gitcafe/zed

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

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

Visibility: public

Requested revision: cb498ace96ab8829d83325b4d8c9828a4f77f57e

Requested commit: cb498ace96ab8829d83325b4d8c9828a4f77f57e

Commit: cb498ace96ab8829d83325b4d8c9828a4f77f57e

Tree: c985949df498e5c48229b535ed795a98c21e3c10

Author: Lee ByeongJun

Committer: GitHub

## Message

```
Surround selection with backticks in Rust, C, and C++ comments (#58674)

Typing a backtick over selected text in Rust, C, and C++ comments
replaced the selection instead of wrapping it. Markdown already supports
this via its backtick bracket pair.

Add a backtick bracket pair for these languages:
  - `surround = true` wraps selections in backticks
  - `close = false` avoids auto-closing lone backticks
  - `not_in = ["string"]` enables it in comments but not strings

Self-Review Checklist:

- [X] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [X] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [X] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable

Closes #58538

Release Notes:

- Added support for surrounding selected text with backticks in Rust, C,
and C++

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
```

## Parents

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

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