-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
"Max attribute characters per line" is not respected even when "Attribute Tolerance"=5 and "Max attributes per line"=8 #450
Comments
In this case, AT will take precedence. Until you cross AT threshold, MAPL and MACPL will have no effect. Notes on MAPL:
You can test this by creating an element with more than 5 attributes: We do not support a hard column limit, nor do we believe it makes much sense to do so with a markup language like XAML given the many other supported ways of breaking up attributes across lines (#12). |
@grochocki In my particular case with the 4 attributes that I have ( I cannot add a 5th attribute just to cause wrapping), how can I cause formatting to wrap while keeping up to 5 short attributes (on another element) on the same line? I tried setting AT=2 and MAPL=8 but that seems to always wrap after 2 attributes no matter what... What would make sense to me is that if MACPL is exceeded, then attributes will be removed from the line until either MACPL is not exceeded or only 1 attribute is left. I set MACPL to my screen width this would avoid having to constantly scroll my view (sometimes really far) in order to see all the attributes. It would at the same time allow me to have several attributes on the same line if they are short. |
How can I separate the two attributes in the first line......... |
@ylyuanlei0110 Thanks for the clear explanation. Unfortunately this means there is no way to prevent the line from going far past the screen width in my scenario (I don't want to decrease AT since that will mess up other formatting, and I cannot add properties just for the sake of breaking up the super long line). This results in poorly formatted lines when 1 property is very long due to complex bindings with converters and parameters, but there < AT other properties on the same line. |
Yeah, I'm confused for this problem recently. Seems no way to fix it with XamlStyler(⊙︿⊙) |
Describe the bug
The MACPL setting says that it will work with AT=5 and MAPL=8, but it has no effect. If I set MACPL=20, then the attributes do not wrap regardless of line length. Is MACPL fundamentally broken or am I doing something wrong?
To Reproduce
Steps to reproduce the behavior:
see above
Expected behavior
If I have 5 properties which make a line of 100 characters, I expect them to be split into separate lines such that each line contains either only 1 property or <= 20 characters.
Screenshots
External Configuration
NA
Version Info (please complete the following information):
Version 17.9.0 Preview 1.0, latest XAML Styler
The text was updated successfully, but these errors were encountered: