-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default comment token to # for unrecognized files #12080
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TornaxO7
reviewed
Nov 17, 2024
TornaxO7
approved these changes
Nov 23, 2024
the-mikedavis
approved these changes
Dec 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning makes sense to me. Previously I was thinking we might want to drop the "default comment token" behavior and refuse to toggle anything for text languages on C-c
but toggling #
is probably a more reasonable default behavior.
pascalkuthe
approved these changes
Dec 5, 2024
GladkihEgor
pushed a commit
to GladkihEgor/helix
that referenced
this pull request
Jan 4, 2025
…r#12080) * Change the default comment token * update test * keep the original
diucicd
pushed a commit
to diucicd/helix
that referenced
this pull request
Jan 8, 2025
…r#12080) * Change the default comment token * update test * keep the original
rmburg
pushed a commit
to rmburg/helix
that referenced
this pull request
Jan 20, 2025
…r#12080) * Change the default comment token * update test * keep the original
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Helix currently uses // as the default comment token for unrecognized file types, but this doesn’t align well with Linux conventions. Since Linux configuration files—such as locale.conf, pacman.conf, and /etc/sudoers—almost always use # for comments, defaulting to // feels out of place.
Files like locale.conf and pacman.conf are sometimes misclassified as HOCON simply because they have a .conf extension, and files without extensions (e.g., sudoers) end up with // as their comment token, which doesn’t match their typical usage.
Most programming languages that use // (e.g., Rust, JavaScript) are easily recognized by their file extensions, whereas files without extensions are more likely to follow Linux conventions and use #. Switching the default to # makes Helix more predictable and practical for Linux users.