Files
Konstantinos StandGitHub efa2987b86 Escape control characters in syntax tree view (#59012)
Escaping control characters so they correctly render in the syntax tree.
Note: the original issue debates whether "\n" should be printed at all.
It should if it's part of the grammar syntax. In the example posted
below, "\n" is printed because it's part of the c-preprocessor grammar,
but "\t" which is not, is not printed.
Note2: I've added an inline test since I saw that only bigger,
integration tests get their own file. Feel free to give guidance on the
topic.

Screenshots of before and after:
<img width="920" height="579" alt="Screenshot 2026-06-10 at 10 42 14"
src="https://github.com/user-attachments/assets/697b65d2-4ca3-4d9b-9cb9-5bc05fe50bf1"
/>
<img width="918" height="580" alt="Screenshot 2026-06-10 at 10 46 20"
src="https://github.com/user-attachments/assets/cb83a105-81a1-4090-8d35-9def2bc1b552"
/>


Self-Review Checklist:

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

Closes #54725

Release Notes:

- Fixed rendering of control-characters in syntax tree view
2026-06-10 09:28:16 +00:00
..