-
Notifications
You must be signed in to change notification settings - Fork 13
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
Column option has no effect #75
Comments
one thing to notice is that column width is not a hard limit. and it mostly apply to scripting mode at this moment. currently typsyle tend to keep content untouched. so the behavior is expected |
@Enter-tainer Hi! I'm migrating from typstfmt where I'd also like to understand the purpose of a soft limit option. Is there a way to configure typstyle to enforce a hard limit like typstfmt did? I'm curious about the reasoning behind this design choice. Thanks! |
can you show relevant code snippets so we can better understand it? |
To clarify this, typstyle only format code. this is one of the main design goals of typstyle:
reflowing content is very risky and error prone. and this only works for languages that use spaces to seprate words. for other languages, it is not even possible to do reflow. Since we cannot do it well, i prefer not touch it and leave it as is. why soft limit: hard limit is impossible to have on corner cases. like you have a variable name of 81 characters. no matter how you format the code, there is always a line exceed the 80 char limit. so typstyle cannot guarantee a hard limit. it can only try its best to meet the soft limit |
see astrale-sharp/typstfmt#164 for example. |
Hm, yes, everything you say makes a lot of sense to me. I didn't think about the risks involved, but that example is a very strong argument (as well as the reasoning to create soft limits instead of hard limits). Thanks for your time and the detailed explanation, I really appreciate it. |
But it would be nice if there was an option if "normal" text would get broken up after the column limit. |
@Wulfheart tracking in #104 |
Hi, thank you for creating and maintaining typstyle!
I noticed an issue with the
--column
option on 0.11.22 (from nixpkgs), where it would not enforce the default or any other configured column width. Wondering if my understanding of this option is wrong, or if the option is just broken at this point.The text was updated successfully, but these errors were encountered: