<div dir="ltr">Woops, pardon me, Marcel!  I have been running with my own version of that method for so long (since 2010), I forgot this was not how it was for everybody.  Please consider Compiler-cmm.480 in the Inbox.  I forgot that Squeak is still mangling comments for everyone else.<div><br></div><div>Comments are humans talking to humans.  It seems to me that the machine has no business getting into the middle of this.  It makes pretty print unusable.  For the code that talks to the machine, its great, but I can't let it get into messing up my comments that are crafted for human consumption.</div><div><br></div><div>Squeak already has an Indent feature built into Text or TextMorph... somewhere.  It would be cool if CodeEditor could take advantage of that.  There are also tools to help us hand-craft like [Tab] when a multi-line selection is selected to do tab indentation.</div><div><br></div><div>But, IMO, comment formatting should _not_ be part of pretty print.</div><div><br></div><div>Best,</div><div>  Chris</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 13, 2022 at 1:38 AM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id="gmail-m_8296417937957954016__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr">Hi Chris --<div></div><div><br></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">> Speaking of which, WHAT in the heck happened to comment</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">> formatting in 6.0?  We've held off improving the pretty printer</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">> to emulate Rectangular Block for years out of respect for original</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">> authors chosen legacy format.  But this new comment formatting</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">> blows that out of the water by changing peoples' **custom-formatted**</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">> comments to  a horrendously narrow, super-tall format!  Please</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">> revert ParseNode>>#printSingleComment:on:indent:.</span><br></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">Hmm... let's unpack this. The only change in that method was:</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">- </span><span style="font-family:Arial,Helvetica,sans-serif;font-size:10pt">tabWidth := TextConstants at: #DefaultTab.</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:10pt">+ </span><span style="font-family:Arial,Helvetica,sans-serif;font-size:10pt">tabWidth := TextStyle default tabWidth.</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:10pt"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:10pt">So, that never changing constant of "24" is now dependent on the</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:10pt">current scale factor or whatever the user configures via </span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:10pt">   </span><span style="font-family:Arial,Helvetica,sans-serif"><span style="font-size:13.3333px">TextStyle numSpacesPerTab</span></span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><span style="font-size:13.3333px"><br></span></span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><span style="font-size:13.3333px">Interesting to see that there seems to be a strange side effect to</span></span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><span style="font-size:13.3333px">what the pretty printer is doing. I cannot see a a conceptual relationship</span></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">at a glance. Maybe the entire algorithm considering the pixel width</span></div><div><span style="font-family:Arial,Helvetica,sans-serif">here is kind of broken.</span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">Sure, we can revert this BUT I would revert it to use a straight</span></div><div><span style="font-family:Arial,Helvetica,sans-serif">   24</span></div><div><span style="font-family:Arial,Helvetica,sans-serif">and not that value from TextConstants. From there, we can figure</span></div><div><span style="font-family:Arial,Helvetica,sans-serif">out a way to improve the algorithm</span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">:-)</span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">Best,</span></div><div><span style="font-family:Arial,Helvetica,sans-serif">Marcel</span></div></div><br>
</blockquote></div>