Skip to content

Normalize line_comments strings to have a trailing space#51033

Merged
JosephTLyons merged 1 commit intozed-industries:mainfrom
injust:line-comments
Mar 10, 2026
Merged

Normalize line_comments strings to have a trailing space#51033
JosephTLyons merged 1 commit intozed-industries:mainfrom
injust:line-comments

Conversation

@injust
Copy link
Copy Markdown
Contributor

@injust injust commented Mar 7, 2026

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 specific to 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

Release Notes:

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

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 7, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Mar 7, 2026
@injust injust changed the title Normalize line_comments strings to have a trailing space character Normalize line_comments strings to have a trailing space Mar 7, 2026
@JosephTLyons
Copy link
Copy Markdown
Collaborator

Thanks for this, @injust!

@JosephTLyons JosephTLyons enabled auto-merge (squash) March 10, 2026 19:30
@JosephTLyons JosephTLyons self-requested a review March 10, 2026 19:30
@JosephTLyons JosephTLyons self-assigned this Mar 10, 2026
@JosephTLyons JosephTLyons merged commit 7132b67 into zed-industries:main Mar 10, 2026
30 checks passed
@injust injust deleted the line-comments branch March 10, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants