[squeak-dev] Pretty-print vs. comments

Marcel Taeumel marcel.taeumel at hpi.de
Wed Jul 13 06:38:25 UTC 2022

Hi Chris --

> Speaking of which, WHAT in the heck happened to comment
> formatting in 6.0?  We've held off improving the pretty printer
> to emulate Rectangular Block for years out of respect for original
> authors chosen legacy format.  But this new comment formatting
> blows that out of the water by changing peoples' **custom-formatted**
> comments to  a horrendously narrow, super-tall format!  Please
> revert ParseNode>>#printSingleComment:on:indent:.

Hmm... let's unpack this. The only change in that method was:

- tabWidth := TextConstants at: #DefaultTab.
+ tabWidth := TextStyle default tabWidth.

So, that never changing constant of "24" is now dependent on the
current scale factor or whatever the user configures via 
   TextStyle numSpacesPerTab

Interesting to see that there seems to be a strange side effect to
what the pretty printer is doing. I cannot see a a conceptual relationship
at a glance. Maybe the entire algorithm considering the pixel width
here is kind of broken.

Sure, we can revert this BUT I would revert it to use a straight
and not that value from TextConstants. From there, we can figure
out a way to improve the algorithm


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220713/06e775bd/attachment.html>

More information about the Squeak-dev mailing list