-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Highlighting is done for file named exactly a language file name extension (rs, py, …) #7029
Comments
This is caused by this check: https://github.com/helix-editor/helix/blame/06d7f5d100fdcc99f4cdfda879898b2d488d8d7c/helix-core/src/syntax.rs#L643. For the most part file types are already treated as extensions. We have the What do you think @the-mikedavis? I saw in the blame that you introduced that syntax. I think |
There is some more discussion of this in #5869. Using suffix for full filenames could be a nice workaround to avoid introducing breaking changes or new file-type formats but it seems a little hacky to me: I would prefer having a |
Ah I wasnt aware of the discussion there. From the issue title I wouldn't have looked there. Using the It's not a huge deal but can cause weird bugs when a language uses a common filename (like |
This was fixed in #8006 |
Summary
Hi.
Helix will enable the Rust syntax highlighting for a file named
rs
, the Python one forpy
, etc.The config should include a leading dot to avoid this.
Thanks.
Reproduction Steps
I tried this:
hx rs
fn
.I expected this to happen:
No syntax highlighting.
Instead, this happened:
fn
got highlighted because helix loads the Rust syntax highlighter.Helix log
n/a
Platform
Linux
Terminal Emulator
alacritty 0.12.0 (5a728195)
Helix Version
helix 23.03
The text was updated successfully, but these errors were encountered: