Closed riotrah closed 1 year ago
Thanks for asking! No, there isn't any way to do this at present. It seems like a reasonable thing to do, and the numbers are sure to be available. I'll see about adding something like this.
Over the past year or so I've put a lot of work into making the justification something that might be more useful, and I'm glad to see that you are using it (or at least interested in using it). It is really quite finicky work, but the results tend to look very nice in many cases.
As I had a minute, I started looking at implementing this. Have you looked at the {:pair {:justify {:max-variance n}}}
configuration parameter? The :max-variance
looks at the sizes of all of the elements on the "left" (other than the ones being ignored for variance), and calculates the variance. If the variance is greater than the max-variance, it won't justify. The :max-gap
is getting at the same thing, but from a slightly different way. It looks only at the distance between the shortest and the longest things (that aren't being ignored for variance). It isn't bad thing, and it might be easier to adjust to your liking, but it definitely is trying to solve the same problem as the max-variance.
It wasn't hard, so I just put it in. That has got to be a record for me from issue to commit. It should come out in 1.2.4
, which will be a while, I expect, as it has some other big features in it.
So, I did this, but it has been a while. It is in 1.2.4
, just out now. Thanks for the idea!
From the CHANGELOG.md
:
Another way to prevent justification of things that will look bad. In addition to {:pair {:justify {:max-variance 20}}}
there is now the, perhaps easier to understand, {:pair {:justify {:max-gap n}}}
, where n is maximum number spaces which will show up between the left and right columns of a bunch of pairs being justified. Note that the :max-gap
is calculated after the:no-justify
and :ignore-for-variance
elements are removed. So if you want them included when calculating the :max-gap
, you need to adjust these parameters as well.
Awesome, thanks so so so much. Will test it out over the next couple weeks ❤️
Ah, nevermind, the vscode version hasn't updated yet, but I hope it does soon!
Hi!
Thank you so much for creating this. It's beautiful.
I tried looking through the reference for the past couple weeks but couldn't figure out how to configure the following - if it isn't already possible, then consider this a feature request for when you have the time:
Thanks so much again