# Normalize \`line_comments\` strings to have a trailing space \(\#51033\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7132b67962e2827f73f8486793ab5d5dcee53862

Requested commit: 7132b67962e2827f73f8486793ab5d5dcee53862

Commit: 7132b67962e2827f73f8486793ab5d5dcee53862

Tree: 33640d7b3486a22fc0b74eba441bac163799fea1

Author: Justin Su

Committer: GitHub

## Message

```
Normalize `line_comments` strings to have a trailing space (#51033)

I did a search for `/^line_comments = .*[^\s\[]"/` to identify these 3
languages:

- Git Commit
- Go Mod
- Go Work

that don't add/remove a trailing space for inline comments. I couldn't
find any indication that the absence of the trailing space is due to any
peculiarity of these languages.

---

For Git Commit, I should note that (strictly speaking) the comment
character is a single `#` without a trailing space, as Git removes any
line starting with the default comment character (`#`) (see
https://git-scm.com/docs/git-config#Documentation/git-config.txt-corecommentChar).

But I believe this change only affects whether `editor::ToggleComments`
adds/removes the space, and not how the file is syntax highlighted. So
for aesthetics and consistency, it should be better to add/remove the
trailing space.

---

Before you mark this PR as ready for review, make sure that you have:

- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Add/remove a space when toggling inline comments in Git Commit and Go
Mod/Work languages
```

## Parents

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

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